-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
1.但是在页面切换过程中,会出现先显示页面内容,然后由于状态栏的出现,整个界面下移一个状态栏高度的问题?
http://blog.csdn.net/u013011318/article/details/48296869
/*
* 在setContent之前调用
* Android 全屏界面切换到非全屏界面的问题
*http://blog.csdn.net/u013011318/article/details/48296869
*/
protected void smoothSwitchScreen() {
// 5.0以上修复了此bug
// if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
ViewGroup rootView = ((ViewGroup) this.findViewById(android.R.id.content));
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
int statusBarHeight = getResources().getDimensionPixelSize(resourceId);
rootView.setPadding(0, statusBarHeight, 0, 0);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
// }
}
Metadata
Metadata
Assignees
Labels
No labels