Why is AppTheme.NoActionBar not working?
If you just let Android Studio auto generate the activity, look in activity_welcome
. There is be android.support.design.widget.AppBarLayout
and if you delete it, the ActionBar should be gone.
You might have an action bar in your layout, or set theme in AndroidManifest file
Try something like this:
<style name="AppTheme.NoActionBar">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>
and set this as the theme of your activity in the manifest, that is:
<activity
...
android:theme="@style/AppTheme.NoActionBar">
</activity>
None of the other answers worked for me, but I found this solution:
Open values/styles.xml
in Android Studio and change 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>
</style>
to:
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- changed .DarkActionBar to .NoActionBar -->
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>