android full screen
/come from google
If you only want to remove the title bar, add this line to onCreate() method of your activity:
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
If you want to set your activity to use the whole display screen, which means also remove the status bar, you need to add one more line:
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_NO_STATUS_BAR,
WindowManager.LayoutParams.FLAG_NO_STATUS_BAR);
translate by forverlove:
设置android 全屏,需要两步:1,去掉标题,2,去掉状态栏
1,去标题
在onCreate()事件中 添加 代码
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
2,去状态栏
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_NO_STATUS_BAR,
WindowManager.LayoutParams.FLAG_NO_STATUS_BAR);
但是后来试过之后发现只要一句就可以了
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
而且WindowManager.LayoutParams.FLAG_NO_STATUS_BAR也没有这个属性
更多相关文章
- Android(安卓)Tablayout 的使用
- Android(安卓)xml资源文件animal动画解析
- Android中的实体类的正确用法
- Android自定义属性与自定义属性的获取
- android:layout_gravity和android:gravity属性的区别
- Android中自定义控件
- Android标题栏各种设置
- Android中全屏无标题设置(Android学习随笔十一)
- Android(安卓)- 设置带滚动条的TextView