作者eva123eva (龙)
看板AndroidDev
标题[问题] 该如何隐藏Navigation bar(海苔条)
时间Tue Sep 1 09:29:28 2015
最近想把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://webptt.com/cn.aspx?n=bbs/AndroidDev/M.1441070970.A.EB9.html
1F:→ egaryer: 他下面第一二点再看看? 应该就是解答 09/01 11:39
2F:→ king5201: 基於安全性原生没办法不要跑出来喔~除非root或贴贴纸(误 09/04 01:55
3F:推 joy0520: 以前试过在主layout设定好touch event,几秒後再照原文设 09/05 02:24
4F:→ joy0520: 定一次,将decor缩回去 09/05 02:24