Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do I have to add to a layout to hide the titlebar?

I want to hide the titlebar of my app in some of my views. What do I have to add to the layout files I want to hide the titlebar in? Can you provide an example?

like image 635
Janusz Avatar asked Mar 15 '10 09:03

Janusz


2 Answers

Do you mean you want the screen going from something similar to this to something similar to that?

If that's what you want, make your theme inherit Theme.NoTitleBar or use it directly. Your opening Activity tag in the AndroidManifest.xml should look somethig like:

<activity android:name=".MyActivity"
    android:theme="@android:style/Theme.NoTitleBar">

If you only want to hide the title, but keep the title bar, you can go with Sephy's recommendations.

like image 199
Dimitar Dimitrov Avatar answered Oct 13 '22 01:10

Dimitar Dimitrov


To do it in code you can just add this line of code to the onCreate() method.

requestWindowFeature(Window.FEATURE_NO_TITLE);
like image 21
Donal Rafferty Avatar answered Oct 13 '22 01:10

Donal Rafferty