Skip to content

引导页跳转主页 既非全屏到全屏bug处理 #1

@luhaoaimama1

Description

@luhaoaimama1

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions