问题如下图:
从一个全屏界面跳转到正常的界面时,顶部份显示半个,会延迟1秒恢复正常。
解决方案:
在跳转界面之前(也就是在全屏的界面),加上以下代码
/**解决进入首页时 上部分显示半个问题*/
Intent intent;
WindowManager.LayoutParams attr = getWindow().getAttributes();
attr.flags &= (~WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().setAttributes(attr);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
intent.setClass(this, MainActivity.class);
startActivity(intent);
finish();
扫描二维码关注公众号,回复:
8589979 查看本文章