欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

android全屏无标题

程序员文章站 2022-07-14 17:42:39
...


1,添加样式
<!-- base -->
<style name="AppBaseTheme" parent="@android:style/Theme.NoTitleBar.Fullscreen">
<item name="android:textColor">@android:color/black</item>
<item name="android:textAppearance">@android:style/TextAppearance.Medium</item>
</style>

2,在manifest中配置android:theme="@style/AppBaseTheme"
<application
android:theme="@style/AppBaseTheme"
... >

3,代码
// 不显示标题
requestWindowFeature(Window.FEATURE_NO_TITLE);
// 全屏
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
相关标签: android