解决荣耀6 机型 解锁后布局混乱的方法

在做手势解锁时 ,发现荣耀6机型在锁屏熄灯,情况下,屏幕再重新点亮。会出现,手势解锁图案压缩变形,此时,需要重新调用 onLayout() 函数,重新绘图 ,实现屏幕解锁正常。

  @Override
    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
        super.onLayout(changed, left, top, right, bottom);
        if (changed){
            //此方法用于解决荣耀6 系列的机型虚拟导航键 解锁后突然改变布局造成九宫格挤压问题
            initCache();
        }
    }

版权声明:本文为博主原创文章,未经博主允许不得转载。(转载请注明出自 AllenCoder)

原文地址:https://www.cnblogs.com/allencoder/p/4830732.html