二、代码中
//full screen
//去掉Activity上面的状态栏
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
//去除title
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
//设置全屏的俩段代码必须在setContentView(R.layout.main) 之前
setContentView(R.layout.main);
二、在配置文件里修改
(关键代码:android:theme="@android:style/Theme.NoTitleBar.Fullscreen",如果想只是去除标题栏就后面不用加Fullscreen了,另外,如果想要整个应用都去除标题栏和状态栏,就把这句代码加到<application..标签里面,如果只是想某个activity起作用,这句代码就加到相应的activity上):
- <activity android:name=".OpenGl_Lesson1"
- android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
- android:label="@string/app_name">