[問題] 該如何隱藏Navigation bar(海苔條)

看板AndroidDev作者 (龍)時間8年前 (2015/09/01 09:29), 編輯推噓1(103)
留言4則, 3人參與, 最新討論串1/1
最近想把APP的畫面做到全銀幕 但是很多裝置的Navigation bar都直接吃掉一排 看過官方的developer的寫法: View decorView = getWindow().getDecorView(); // Hide both the navigation bar and the status bar. // SYSTEM_UI_FLAG_FULLSCREEN is only available on Android 4.1 and higher, but as // a general rule, you should design your app to hide the status bar whenever you // hide the navigation bar. int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN; decorView.setSystemUiVisibility(uiOptions); 這方法有效,但只要一碰觸到畫面 Navigation bar就會再浮現出來 請問該如何將固定不要讓它跑出來? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.134.22.57 ※ 文章網址: https://www.ptt.cc/bbs/AndroidDev/M.1441070970.A.EB9.html

09/01 11:39, , 1F
他下面第一二點再看看? 應該就是解答
09/01 11:39, 1F

09/04 01:55, , 2F
基於安全性原生沒辦法不要跑出來喔~除非root或貼貼紙(誤
09/04 01:55, 2F

09/05 02:24, , 3F
以前試過在主layout設定好touch event,幾秒後再照原文設
09/05 02:24, 3F

09/05 02:24, , 4F
定一次,將decor縮回去
09/05 02:24, 4F
文章代碼(AID): #1LvFzwwv (AndroidDev)