1. 在AndroidManifest.xml 文件中,設定Activity為全屏模式。
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
2. 程式實現全屏
2.1 隱藏狀態欄
requestWindowFeature(Window.FEATURE_NO_TITLE);
2.2 隱藏標題欄
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
2.3 隱藏工具欄
此處搜尋過,無法強制隱藏工具欄。
PS: 以程式實現全屏,必須'放在 setContentView 前才有效果。
沒有留言:
張貼留言