android 如何去掉状态栏和标题栏

修改对应的Activity,添加以下代码:
final Window win = getWindow();
win.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN); //remove statusbar
requestWindowFeature(Window.FEATURE_NO_TITLE);
requestWindowFeature(Window.FEATURE_PROGRESS); //remove titlebar
注意:必须添加在setContentView()方法之前,否则将提示错误。

你可能感兴趣的:(android)