Tencent / QMUI_iOS

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

QMUIHelper.safeAreaInsetsForDeviceWithNotch在Mac Catalyst上不准确 #1175

Closed jiasongs closed 2 years ago

jiasongs commented 3 years ago

Bug 表现 QMUIHelper.safeAreaInsetsForDeviceWithNotch在Mac Catalyst上不准确,Mac Catalyst上有个“tool bar”

图片

通过keyWindow.safeAreaInsets拿到的结果是

图片

截图 如上图

如何重现 run in Mac Catalyst

预期的表现 QMUIHelper.safeAreaInsetsForDeviceWithNotch在其他平台上也能得到正确的结果

其他信息

MoLice commented 2 years ago

mac 上的 toolbar 也是可以隐藏的,QMUIHelper.safeAreaInsetsForDeviceWithNotch 的设计本意更希望用于“无法动态获取 safeAreaInsets 时不得已才用”的方法,更希望用来表达硬件层面的 safeAreaInsets 信息,所以该方法不修改。

lwl-blazer commented 1 year ago

此函数下的UIInterfaceOrientation orientation = UIApplication.sharedApplication.statusBarOrientation; 在iOS16是不是需要做适配,