问题描述
我想在我的某些视图中隐藏我的应用程序的标题栏.我需要在布局文件中添加什么来隐藏标题栏?你能举个例子吗?
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?
推荐答案
Do you mean you want the screen going from something similar to this to something similar to that?
如果这就是你想要的,让你的主题继承 Theme.NoTitleBar
或直接使用它.您在 AndroidManifest.xml 中打开的 Activity
标记应该类似于:
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">
如果你只想隐藏标题,但保留标题栏,你可以按照Sephy的建议去做.
If you only want to hide the title, but keep the title bar, you can go with Sephy's recommendations.
这篇关于我必须在布局中添加什么才能隐藏标题栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!