一、繼承自Activity的activity實(shí)現(xiàn)方法
方法1:在AndroidManifest.xml中配置
全屏效果:
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
無(wú)標(biāo)題欄(但有系統(tǒng)狀態(tài)欄):
android:theme="@android:style/Theme.NoTitleBar"
要是只想對(duì)某個(gè)activity設(shè)置成無(wú)標(biāo)題,只要對(duì)該activity配置上述屬性即可
方法2:在activity中的onCreate()中 setContentView方法之前加入如下代碼:
// 全屏
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
// 無(wú)標(biāo)題欄
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
二、繼承自AppCompatActivity的activity實(shí)現(xiàn)方法
消除標(biāo)題欄:在AndroidManifest.xml中配置
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
轉(zhuǎn)自https://blog.csdn.net/qq_22945151/article/details/53364621