Tencent / QMUI_iOS

QMUI iOS——致力于提高项目 UI 开发效率的解决方案
http://qmuiteam.com/ios
Other
7.07k stars 1.37k forks source link

非全面屏的 Regular 设备,仅支持竖屏的 App 在横屏启动时界面错乱 #1263

Closed jiasongs closed 2 years ago

jiasongs commented 3 years ago

Bug 表现 手机横屏启动的情况下,进入首页后UI会显示异常,如录屏所示,「导航栏和Tabbar」的高度都变小了,状态栏消失不见。

截图 以下录屏为「横屏启动」: https://user-images.githubusercontent.com/22904757/123778914-322f7680-d904-11eb-9547-92fb3508cb20.mp4

如何重现 0、使用iPhone7,iPhoneSE等「非全面屏且桌面不支持横屏」的设备稳定复现 1、info.plist只勾选Portrait

图片

2、AppDeleagte里实现

图片

3、设置QMUICMI.supportedOrientationMask = UIInterfaceOrientationMaskPortrait; 4、横屏启动QMUIDemo

可复现的Demo,全局搜索语句"QMUI_iOS/issues/1263" 查看改动的地方 QMUIDemo.zip

预期的表现 手机横屏启动的情况下,进入首页后也会正常显示

其他信息

jiasongs commented 3 years ago

是下图所示的红圈代码导致的,系统先访问了viewController的supportedOrientationMask得到的是UIInterfaceOrientationMaskAll,所以才会有这个问题,去掉这段代码就正常了。

图片

临时写了个解决办法:

图片 图片
MainByElse commented 3 years ago

same issue

jiasongs commented 3 years ago

same issue https://github.com/Tencent/QMUI_iOS/issues/1257

MoLice commented 3 years ago

提供的 Demo 运行起来是这样?

jiasongs commented 3 years ago

提供的 Demo 运行起来是这样?

「iPhone 8 Plus」机型看起来不明显,但还是有问题,横屏后状态栏没有了,但是首页并没有隐藏状态栏的代码。

下图是「iPhone 7」的效果,问题就非常明显了,上下导航栏的高度都小了。

图片
MoLice commented 2 years ago

已发布 4.3.0 修复该问题。