How do I remove the title bar from my app?

Jonas picture Jonas · Oct 21, 2014 · Viewed 311.3k times · Source

In my app there is this title bar at the top where the overflow menu would be, but I don't need settings and only have one screen. When I change the theme like described in many other questions I get the old 2.2 theme. I want to have the modern theme just without the bar at the top.

Answer

Mr. Torres picture Mr. Torres · Feb 24, 2016

Go to styles.xml and change .DarkActionBar for .NoActionBar

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
</style>

becomes

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
</style>

if colors are irrelevant to your app, you can actually go for

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar" />