Reputation: 51
I want to hide the title bar in all activities of my app. To do that, I put the following attribute in the tag:
android:theme="@android:style/Theme.NoTitleBar"
The title bar is now hidden, but my problem is that my app looks weird with that attribute.
Before:
http://imageshack.us/a/img831/6905/screenshot1355296053406.png
with the noTitleBar attribute:
http://imageshack.us/a/img211/581/screenshot1355295921669.png
It looks like there is less contrast..
It makes no difference if the noTitleBar
attribute is in the application tag or in each activity tag.
Hope you can help me with my problem.
Upvotes: 5
Views: 356
Reputation: 787
You've accepted no answer so I'm going to toss my 2 cents in here:
Adding this snippet of code might be helpful:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
Upvotes: 0
Reputation: 1884
It's probably because you have also removed the Theme of your application together with the title bar.
I'm not sure what your theme was before, but you should extend an existing theme. Something like this in your styles file:
<style name="MyTheme" parent="android:Theme.Light.NoTitleBar.">
</style>
Maybe your parent theme should be android:Theme.Black.NoTitleBar
?
Upvotes: 2
Reputation: 3261
In onCreate()
of activity write following:
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
Upvotes: 4