看图,截图的页面被Status Bar覆盖了,那么怎样修改可以覆盖在statusbar之上呢?
/**
* The general type of window. There are three main classes of
* window types:
* <ul>
* <li> <strong>Application windows</strong> (ranging from
* {@link #FIRST_APPLICATION_WINDOW} to
* {@link #LAST_APPLICATION_WINDOW}) are normal top-level application
* windows. For these types of windows, the {@link #token} must be
* set to the token of the activity they are a part of (this will
* normally be done for you if {@link #token} is null).
* <li> <strong>Sub-windows</strong> (ranging from
* {@link #FIRST_SUB_WINDOW} to
* {@link #LAST_SUB_WINDOW}) are associated with another top-level
* window. For these types of windows, the {@link #token} must be
* the token of the window it is attached to.
* <li> <strong>System windows</strong> (ranging from
* {@link #FIRST_SYSTEM_WINDOW} to
* {@link #LAST_SYSTEM_WINDOW}) are special types of windows for
* use by the system for specific purposes. They should not normally
* be used by applications, and a special permission is required
* to use them.
* </ul>
*
* @see #TYPE_BASE_APPLICATION
* @see #TYPE_APPLICATION
* @see #TYPE_APPLICATION_STARTING
* @see #TYPE_DRAWN_APPLICATION
* @see #TYPE_APPLICATION_PANEL
* @see #TYPE_APPLICATION_MEDIA
* @see #TYPE_APPLICATION_SUB_PANEL
* @see #TYPE_APPLICATION_ATTACHED_DIALOG
* @see #TYPE_STATUS_BAR
* @see #TYPE_SEARCH_BAR
* @see #TYPE_PHONE
* @see #TYPE_SYSTEM_ALERT
* @see #TYPE_TOAST
* @see #TYPE_SYSTEM_OVERLAY
* @see #TYPE_PRIORITY_PHONE
* @see #TYPE_SYSTEM_DIALOG
* @see #TYPE_KEYGUARD_DIALOG
* @see #TYPE_SYSTEM_ERROR
* @see #TYPE_INPUT_METHOD
* @see #TYPE_INPUT_METHOD_DIALOG
*/
我们需要参考view的type,这里我们选择TYPE_KEYGUARD_DIALOG,即可实现
/**
* Window type: dialogs that the keyguard shows
* In multiuser systems shows on all users' windows.
*/
public static final int TYPE_KEYGUARD_DIALOG = FIRST_SYSTEM_WINDOW+9;
使用的时候
params.type = WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG;