在Android应用程序的MainActivity的onCreate()函数中加代码即可:
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
//隐去标题栏(应用程序的名字)
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
//隐去状态栏部分(电池等图标和一切修饰部分)
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
}
}
时间: 2024-10-14 14:32:12