一种是在代码中的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