ios - 呈现 UIViewController 时 SafeAreas 行为不端
问题描述
我需要从另一个仅支持“.portrait”方向的 UIViewController (ViewControllerOne) 中展示一个仅支持“.landscape”方向的 UIViewController (ViewControllerTwo)。如果您检查下面的 .gif,您会注意到当转换发生时它会缩小“ViewControllerOne”的内容,而当您关闭“ViewControllerTwo”时也会发生同样的情况。
出现这种情况的原因与安全区域的变化有关,纵向与横向不同,反之亦然。但是,如果我们覆盖“ViewControllerOne”的supportedInterfaceOrientations 以仅支持“.portrait”,如果这些更改与不受支持的方向相关,则不应通知安全区域更改,对吧?
这是来自 iOS 的错误/限制吗?
(NO) -> What is the right way to handle this scenario?
(YES) -> What workaround do you recommend to solve this issue in the meantime?
您可以在此处查看示例项目:https ://github.com/mantuness/ExampleProject
检查下面的GIF:
解决方案
推荐阅读
- php - 将数据导出到excel表时如何将数据库的行值转换为列值?
- php - Google Cloud PHP Translate 使用什么版本的翻译 API?
- php - 通过模块升级创建自定义客户属性 (UpgradeData.php)
- ios - 等待网络调用完成
- python - 当axis = 0时,Keras BatchNormalization仅适用于恒定批次暗淡?
- firefox - 如何从 Firefox 插件中读取配置文件首选项?
- javascript - 从本地存储中删除整个阵列
- sql - 列中的分组和空值
- reactjs - 如何用 GatsbyJS 响应式图像替换 HTML 图像?
- batch-file - 在不更改已经存在的环境变量的情况下更新 PATH