我必须在布局中添加什么才能隐藏标题栏? [英] What do I have to add to a layout to hide the titlebar?

查看:25
本文介绍了我必须在布局中添加什么才能隐藏标题栏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的某些视图中隐藏我的应用程序的标题栏.我需要在布局文件中添加什么来隐藏标题栏?你能举个例子吗?

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?

推荐答案

你的意思是你想让屏幕从类似于 this 类似于 那个?

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.

这篇关于我必须在布局中添加什么才能隐藏标题栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆