隱藏Title Bar (標題列)and  Notification Bar(通知列)
可實現螢幕最大化

===================================================

Title Bar 可以在xml或java裡實作

1.AndroidManifest.xml

在activity裡插入

android:theme="@android:style/Theme.NoTitleBar"

2.在java裡加上this.requestWindowFeature(Window.FEATURE_NO_TITLE)

剛剛try了一下只能在onCreate裡才不會FC

而且要setContentView上面不然一定FC


super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);//隱藏title bar
setContentView(R.layout.main);
====================================================

令Notification Bar隱藏

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN

                                  ,WindowManager.LayoutParams.FLAG_FULLSCREEN);

令Notification Bar顯示

getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);


arrow
arrow
    文章標籤
    Notification Bar Title Bar
    全站熱搜

    cookiesp 發表在 痞客邦 留言(0) 人氣()