2012-04-03 10 views
5

私はエラーが何を伝えているのか理解していますが、私がカスタムタイトルと結合しようとしているタイトル機能を考慮しています。カスタムタイトルと他のタイトル機能を組み合わせることはできません

inspection_title.axml

<?xml version="1.0" encoding="utf-8"?> 
    <TextView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/inspectionTitle" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:ellipsize="marquee" 
    android:marqueeRepeatLimit="-1"/> 

LiftInspection.cs

[Activity(ScreenOrientation = Android.Content.PM.ScreenOrientation.Portrait)] 
public class LiftInspection : ExpandableListActivity 
{  
    protected override void OnCreate(Bundle bundle) 
    { 
     base.OnCreate(bundle); 

     string callInfo = Intent.GetStringExtra("CallInfo");   

     RequestWindowFeature(WindowFeatures.CustomTitle); 
     SetContentView(Resource.Layout.LiftInspection); 
     Window.SetFeatureInt(WindowFeatures.CustomTitle, Resource.Layout.inspection_title); 

     TextView title = (TextView) FindViewById(Resource.Id.inspectionTitle); 
     title.Text = callInfo; 
    } 

マニフェストか何かで追加のタイトルのカスタマイズはありません。この例外を生成するためにCustomTitleと組み合わせることができますか?

+2

私を助けてくれ、あなたをしました問題を解決する ?私は同じことに直面しています:( – kinghomer

答えて

0

この方法を試してみてください。

final Window window = getWindow(); 
boolean useTitleFeature = false; 
if(window.getContainer() == null) { 
    useTitleFeature = window.requestFeature(Window.FEATURE_CUSTOM_TITLE); 
} 
    SetContentView(Resource.Layout.LiftInspection); 
if (useTitleFeature) { 
    window.setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.inspection_title); 
} 
+3

前と同じ結果です – jmease

3

のAndroidManifest.xmlにチェックあなたのテーマの名前が「AppTheme」であれば、これ以外にそれを変更しようとするならば、それは奇妙だが、それは

+0

奇妙ですが私のために働きます。@androidに変更しました:style/Theme – Trung

関連する問題