Androidのカスタムタイトルに関する質問You cannot combine custom titles with other title features

5040 ワード

Activityにコードを追加:
		requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
		setContentView(R.layout.activity_main);
		getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title);

問題の現象は以下の通りです.
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.qqlogin/com.example.qqlogin.MainActivity}: android.util.AndroidRuntimeException: You cannot combine custom titles with other title features
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2114)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2139)
at android.app.ActivityThread.access$700(ActivityThread.java:143)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1241)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4963)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.util.AndroidRuntimeException: You cannot combine custom titles with other title features
at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:289)
at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:3118)
at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:3358)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:314)
at android.app.Activity.setContentView(Activity.java:1924)
at com.example.qqlogin.MainActivity.onCreate(MainActivity.java:30)
at android.app.Activity.performCreate(Activity.java:5184)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2078)
... 11 more

この問題はmanifestでactivityを追加してトピックを追加していません
           //        ,     
            
                
                
            
        

システムに付属のトピックを使用:android:theme="@style/android:Theme.Light"
トピックスタイル@styleの使用
android:Theme:
android:theme="@android:style/theme.Dialog":Activityがダイアログモードとして表示されます
android:theme="@android:style/theme.NoTitleBar":アプリケーションタイトルバーは表示されません
android:theme="@android:style/theme.NoTitleBar.Fullscreen":アプリケーションタイトルバーは表示されず、フルスクリーン
android:theme="Theme.Light":背景が白
android:theme="Theme.Light.NoTitleBar":白い背景にタイトルバーはありません
android:theme="Theme.Light.NoTitleBar.Fullscreen":白い背景、タイトルバーなし、フルスクリーン
android:theme="Theme.Black":背景黒
android:theme="Theme.Black.NoTitleBar":黒い背景にタイトルバーはありません
android:theme="Theme.Black.NoTitleBar.Fullscreen":黒い背景、タイトルバーなし、フルスクリーン
Android:theme="Theme.Wallpaper":システムデスクトップをアプリケーションの背景とする
Android:theme="Theme.Wallpaper.NoTitleBar":システムデスクトップをアプリケーションの背景とし、タイトルバーはありません
Android:theme="Theme.Wallpaper.NoTitleBar.Fullscreen":システムデスクトップをアプリケーションの背景とし、タイトルバーなし、フルスクリーン
android:theme="Theme.Translucent:透明な背景
android:theme="Theme.Translucent.NoTitleBar":透明な背景にタイトルはありません
android:theme="Theme.Translucent.NoTitleBar.Fullscreen":透明な背景にタイトルはなく、フルスクリーン
android:theme="Theme.Panel":パネルスタイル表示
android:theme="Theme.Lights.Panel":フラットパネルスタイル表示
android:Theme.ライトはこれを使って間違いを報告しません
------AppBaseThemeはこれを使って同じようにエラーを報告します
------AppThemeはこれを使って同じようにエラーを報告します
独自のトピックを使用することもできます:android:theme='@style/titlebarstyle'カスタムトピックスタイルは、システムトピックを継承する必要があります
    
     
      
       android:theme="@style/android:Theme.Light">