Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I remove the title bar from my app?

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.

like image 991
Jonas Avatar asked Oct 21 '14 17:10

Jonas


People also ask

How do I disable the title bar?

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.

How do I hide the app bar?

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.


1 Answers

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" /> 
like image 144
Mr. Torres Avatar answered Sep 21 '22 07:09

Mr. Torres