学习了android开发,发现Android 隐去标题栏设置全屏的方法
本篇文章来源于好岸园it技术学习网 (http://www.hopean.com)
原文链接:http://www.hopean.com/devlop/
详细代码如下:
package com.example.gamesview;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.app.Activity;
import android.view.Menu;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.activity_main);
//隐去标题栏(应用程序的名字)
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
//隐去状态栏部分(电池等图标和一切修饰部分)
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
//设置显示View实例
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}