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.
So basically we just need to change DarkActionBar to NoActionBar. NoActionBar theme prevents the app from using the native ActionBar class to provide the app bar. Thus it removes the title of every activity.
If you want to hide Action Bar from the entire application (from all Activities and fragments), then you can use this method. Just go to res -> values -> styles. xml and change the base application to “Theme. AppCompat.
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" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With