匿名用户
方法1:如果您只想在初始屏幕中隐藏状态栏,那么在Oncreate()方法中执行此操作:@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
getSupportActionBar().hide();
}
方法2:如果上面的方法不起作用,试试这个方法://Remove title bar
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
//Remove notification bar
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
//set content view AFTER ABOVE sequence (to avoid crash)
this.setContentView(R.layout.your_layout_name_here);
方式3:我通常使用此代码,但在AndroidManifest.xml中:
android:name=".zSplashScreen"
android:theme="@style/SplashScreen">
在您正在显示的清单文件中找到activity或初始屏幕,然后通过更改主题隐藏它。