android 设置全屏的三种方式

一:动态编码的方式:
// 去掉窗口标题
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"
三:
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:windowNoTitle">true</item><!-- 没有标题 -->
</style>

猜你喜欢

转载自blog.csdn.net/sinat_26397681/article/details/80795582