AppCompat不支持当前的主题功能

时间:2016-01-04 09:55:53

标签: android android-layout android-activity

Studio给出了如下错误。我怎么解决这个问题?我试过其他解决方案。但他们不工作。模拟器的API:21。所有其他API的工作原理。但在这给了我错误。单击“导航”抽屉菜单中的某个项目时,它会崩溃

错误输出:

java.lang.RuntimeException: Unable to start activity  ComponentInfo{com.dd.myApplicaiton/com.d.myapplication.category.CategoryActivityDialog}: 
java.lang.IllegalArgumentException: AppCompat does not support the current theme features: { windowActionBar: false, windowActionBarOverlay: false, android:windowIsFloating: false, windowActionModeOverlay: true, windowNoTitle: false }
                                                                             at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
                                                                             at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
                                                                             at android.app.ActivityThread.access$800(ActivityThread.java:144)
                                                                             at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
                                                                             at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                             at android.os.Looper.loop(Looper.java:135)
                                                                             at android.app.ActivityThread.main(ActivityThread.java:5221)
                                                                             at java.lang.reflect.Method.invoke(Native Method)
                                                                             at java.lang.reflect.Method.invoke(Method.java:372)
                                                                             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
                                                                             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
                                                                          Caused by: java.lang.IllegalArgumentException: AppCompat does not support the current theme features: { windowActionBar: false, windowActionBarOverlay: false, android:windowIsFloating: false, windowActionModeOverlay: true, windowNoTitle: false }
                                                                             at android.support.v7.app.AppCompatDelegateImplV7.createSubDecor(AppCompatDelegateImplV7.java:423)
                                                                             at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:280)
                                                                             at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:254)
                                                                             at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
                                                                             at com.d.d.common.BaseMenuActivity.onCreate(BaseMenuActivity.java:71)
                                                                             at com.d.d.category.CategoryActivity.onCreate(CategoryActivity.java:30)
                                                                             at com.d.d.category.CategoryActivityDialog.onCreate(CategoryActivityDialog.java:14)
                                                                             at android.app.Activity.performCreate(Activity.java:5933)
                                                                             at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
                                                                             at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
                                                                             at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360) 
                                                                             at android.app.ActivityThread.access$800(ActivityThread.java:144) 
                                                                             at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278) 
                                                                             at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                             at android.os.Looper.loop(Looper.java:135) 
                                                                             at android.app.ActivityThread.main(ActivityThread.java:5221) 
                                                                             at java.lang.reflect.Method.invoke(Native Method) 
                                                                             at java.lang.reflect.Method.invoke(Method.java:372) 
                                                                             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) 
                                                                             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) 

的themes.xml

 <style name="MyTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:actionButtonStyle">@style/ActionButtonStyle</item>
        <item name="android:buttonStyle">@style/ButtonStyle</item>
        <item name="android:textColor">@android:color/black</item>
        <item name="android:checkboxStyle">@style/CheckBoxStyle</item>
        <item name="android:textColorHighlight">#9963c531</item>
        <item name="android:listViewStyle">@style/ListViewTheme</item>
        <item name="android:listViewWhiteStyle">@style/ListViewTheme.White</item>
        <item name="android:windowBackground">@color/gray_light</item>
        <item name="android:colorBackground">@color/gray_light</item>
        <item name="android:ratingBarStyle">@style/RatingBarTheme</item>
        <item name="android:ratingBarStyleSmall">@style/RatingBarSmallTheme</item>
        <!-- Support library compatibility -->
        <item name="actionButtonStyle">@style/ActionButtonStyle</item>
        <item name="drawerArrowStyle">@style/DrawerArrowStyle</item>

        <item name="colorPrimaryDark">#B8A877</item>
    </style>

0 个答案:

没有答案