- 编码的方式:
// 去掉窗口标题 requestWindowFeature(Window.FEATURE_NO_TITLE); // 隐藏顶部的状态栏 getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(); |
- 配置方式:
//方式二(不建议使用) android:theme="@android:style/Theme.Black.NoTitleBar" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
//方式三 <stylename="AppTheme"parent="AppBaseTheme"> <itemname="android:windowNoTitle">true</item><!-- 没有标题 --> </style> |
沉浸式状态栏
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);