Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
267 views
in Technique[技术] by (71.8m points)

android - 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...