Android设置全屏两种方式
16lz
2021-01-23
一种是在代码中的onCreate方法中:
参考: http://www.freehum.com/2011/06/android-fullscreen.html
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //无title requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams. FLAG_FULLSCREEN); setContentView(R.layout.main); }
一种是直接在xml的布局文件中设置Them属性:
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
参考: http://www.freehum.com/2011/06/android-fullscreen.html
更多相关文章
- Android屏幕属性应用
- Android小项目之欢迎滑动页面(页面布局&底部点点)
- Android在程序中动态生成控件,动态布局
- android 相对布局例子代码
- android 用代码设置margin属性,textView加粗
- Android Studio 添加百分比布局库的依赖报错 第一行代码