-1
WindowManager manager = ((WindowManager) context.getApplicationContext()
.getSystemService(Context.WINDOW_SERVICE));
WindowManager.LayoutParams localLayoutParams = new WindowManager.LayoutParams();
localLayoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ERROR;
localLayoutParams.gravity = Gravity.TOP;
localLayoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE|
// this is to enable the notification to recieve touch events
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON |
// Draws over status bar
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
localLayoutParams.width = WindowManager.LayoutParams.MATCH_PARENT;
manager.getDefaultDisplay().getHeight();
localLayoutParams.height = (int) (25 * context.getResources()
.getDisplayMetrics().scaledDensity);
localLayoutParams.format = PixelFormat.TRANSPARENT;
view = new customViewGroup(context);
manager.addView(view, localLayoutParams);
由於頂部隱形view
,我的應用程序頂部按鈕不會收到click
事件。你可以請建議一種方法,我可以禁用status bar
,而不禁用應用程序的頂端?禁用狀態欄時,應用程序不會收到點擊
這種風格隱藏狀態欄,但你仍然可以通過滑動打開它,我需要在我的啓動器應用上禁用該功能。 –