简体   繁体   中英

What is the difference between hiding title in xml or via java code?

(我不知道它是否相关,但我想在我的应用程序中使用自定义主题。)我应该使用哪个和为什么(性能问题,简单等)?

There is no real difference.

You can choose what best suits your needs.

If you know you'll want the title to be hidden in every activity of your application then the best solution is to set a theme for the whole application in your AndroidManifest.xml file

<application android:theme="@android:style/Theme.Black.NoTitleBar">

Of course you can change @android:style/Theme.Black.NoTitleBar to your custom style.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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