0
点赞
收藏
分享

微信扫一扫

如何隐藏android的屏幕上的Title Bar


1. 在Activity中的onCreate方法中加入如下代码:

//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);


2.修改AndroidManifest.xml中的activity节点的theme属性


<activity android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">


3.修改AndroidManifest.xml中的application节点的theme属性


举报

相关推荐

0 条评论