本日學習:

隱藏狀態列與標題列,擴大螢幕可用範圍
但相對的需要注意排版問題 ...

1. 在 AndroidMainfast.xml 檔案中,對要隱藏狀態列與標題列之 Activity 加入屬性:
<activity android:name=".MaintainStockOutInfo"
         android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

 
2. onCreate() event :
        //設定全螢幕顯示
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN ,WindowManager.LayoutParams.FLAG_FULLSCREEN);

        //隱藏標題列 ( 須寫在 setContentView 之前 )
        requestWindowFeature(Window.FEATURE_NO_TITLE);

        setContentView(R.layout.stockout);

arrow
arrow
    文章標籤
    android full screen
    全站熱搜

    瘋狂螞蟻 發表在 痞客邦 留言(0) 人氣()