在切换视图后(实际步骤在 设置->显示与亮度->视图)发现App中前端页面有些问题。
iphone在设置了增大视图之后,正常通过以下方法,获取的宽和高会产生变化,会影响依据宽高判断的方法。
我们App判断iOS刘海屏高度时依据的屏幕的宽高。
css中 通过固定值设置
@media only screen and (device-width:375px) and (device-height:812px) and (-webkit-device-pixel-ratio:3) padding-top:44px }
iphone 12 , 12pro,13,13pro 标准视图 390*844 放大视图 320*693 scale:3
iphone 12 pro max , 13 pro max 标准视图 428*926 放大视图 375*812 scale:3
iphone 12 mini , 13mini 标准视图 375*812 放大视图 320 * 693
mini机型比较特别,因为官网介绍 (1080 * 2340 物理分辨率) , 实际可知mini 在 1125 * 2436 渲染分辨率,渲染分辨率比物理分辨率大一丢丢。