Why AppCompat does not support the current theme features windowActionBar: false

假装没事ソ 提交于 2019-12-01 14:21:04

Try this,

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>

    <item name="windowActionBar">false</item>
    <item name="windowActionBarOverlay">false</item>
    <item name="windowIsFloating">false</item>
    <item name="windowActionModeOverlay">false</item>
    <item name="windowNoTitle">false</item>
</style>

go to your styles.xml and change you main theme parent with NoActionBar like this

 <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
 </style>

You need to check both styles files styles.xml and styles.xml(v21) in case you have it in your code.

Both styles files must have a parent theme based on the Theme.AppCompat theme, or a child of it.

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    ...
</style>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!