注意!写requestWindowFeature时要放在setContentView(R.layout.activity_main);前面
requestWindowFeature(Window.FEATURE_NO_TITLE);
//标题栏显示进度条
requestWindowFeature(Window.FEATURE_PROGRESS);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PRORESS);
setProgressBarVisibility(true);
setProgressBarIndeterminate(true);
在style文件中的style下加入
<item name="android:windowNoTitle">true</item>
不显示标题栏(在AndroidManifest.xml文件中设置)
android:theme="@android:style/Theme.NoTitleBar"
全屏
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
不显示状态栏:
//去掉Activity上面的状态栏
getWindow().setFlags(WindowManager.LayoutParams. FLAG_FULLSCREEN ,
WindowManager.LayoutParams. FLAG_FULLSCREEN);
另一种方法(推荐):
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"