![](/img/trans.png)
[英]how to disable status bar or notification bar but not disable title bar in android?
[英]Disable the android notification bar
我只想知道如何在不使我的活動全屏顯示的情況下禁用手機中的通知欄?
我正在做一個鎖屏,我不希望用戶可以拖動通知欄。
將此代碼添加到您的AndroidManifest.xml中
android:theme =“ @ android:style / Theme.NoTitleBar”
public static void CancelNotification(Context ctx,int notifyId){字符串ns = Context.NOTIFICATION_SERVICE; NotificationManager nMgr =(NotificationManager)ctx.getSystemService(ns); nMgr.cancel(notifyId); }
這聽起來像您所需要的。 它參與創建一個透明窗口,該窗口與狀態欄重疊,從而攔截到其的所有觸摸事件。
您仍將保留狀態欄,用戶將無法激活它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.