簡體   English   中英

如何在鎖定屏幕上禁用通知欄和狀態欄?

[英]How to disable notification bar and status bar on lock screen?

我已經嘗試了以下代碼,但仍然無法正常工作。

requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);

您可以嘗試以下方法,

View view = getWindow().getDecorView();

// Hide the Status bar
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
view.setSystemUiVisibility(uiOptions);

// Hide ActionBar
ActionBar actionBar = getActionBar();
actionBar.hide();

或只需在清單中添加樣式,

android:theme="@android:style/Theme.Holo.NoActionBar.Fullscreen" 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM