简体   繁体   English

如何在Android应用程序中隐藏标题栏

[英]How can I hide the title bar in an android application

I have been trying to find a way to hide the title bar in my android application. 我一直试图找到一种方法来隐藏我的android应用程序中的标题栏。 I used @android:style/Theme.NoTitleBar.Fullscreen in the android manifest. 我在android清单中使用了@android:style / Theme.NoTitleBar.Fullscreen It worked but the background gets set to black and all the text views get set to white. 它可以工作,但是背景设置为黑色,所有文本视图设置为白色。 Is their a way to have the background set to white and text to black without having to set them all individually? 他们是否有一种方法可以将背景设置为白色,将文本设置为黑色,而不必分别设置它们?

You can ovveride the Theme.NoTitleBar.Fullscreen background color/text colors by applying additional styles. 您可以通过应用其他样式来遍历Theme.NoTitleBar.Fullscreen背景颜色/文本颜色。 For example if you wanted your background color to be white you would apply the style: 例如,如果您希望背景颜色为白色,则可以应用以下样式:

@color/your_background__color @ color / your_background__color

For a simple version, try to use Theme.AppCompat.Light.NoActionBar . 对于简单版本,请尝试使用Theme.AppCompat.Light.NoActionBar This will keep "light" theme but remove action bar. 这将保持“浅色”主题,但删除操作栏。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM