2014-10-10 37 views
1

我在自助服務終端模式App中遇到了狀態欄問題。Android kiosk模式應用 - 正在運行狀態欄

我想知道如何隱藏狀態欄我知道是否可以在4.4.2 Kitkat中永久禁用它?但我發現不錯的應用程序-KioWare。

當我抓住狀態欄時,有很酷的模式,它很快就會回到頂部。在0.05秒內。我無法點擊任何內容。這就是我要找的。

我不能購買這個應用程序,因爲它是昂貴的,我只需要與狀態欄這個魔術。任何人都可以幫助我?它應該只有幾行代碼。

回答

0

我寫了一篇文章,涵蓋了這個問題,但專門爲棒棒糖。我不確定Android 5中的沉浸式模式是否也適用於4.4.2,但是可以嘗試一下嗎?

http://www.sureshjoshi.com/mobile/android-kiosk-mode-without-root/

@Override 
protected void onResume() { 
    super.onResume(); 
    hideSystemUI(); 
} 

// This snippet hides the system bars. 
private void hideSystemUI() { 
    // Set the IMMERSIVE flag. 
    // Set the content to appear under the system bars so that the content 
    // doesn't resize when the system bars hide and show. 
    mDecorView.setSystemUiVisibility(
      View.SYSTEM_UI_FLAG_LAYOUT_STABLE 
        | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION 
        | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN 
        | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar 
        | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar 
        | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); 
} 
相關問題