Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIViewController (QMUI) 强制旋转设备方向的功能也会影响浮层里的 viewController 导致 bug #291

Closed
4 tasks done
MoLice opened this issue Mar 29, 2018 · 1 comment
Labels

Comments

@MoLice
Copy link
Collaborator

MoLice commented Mar 29, 2018

请填写运行环境

  • 设备:模拟器
  • 系统:iOS 11.2
  • Xcode 版本:9.2
  • QMUI iOS 版本:2.4.0

请描述具体问题

UIViewController (QMUI)viewWillAppear: 里实现配置表的 AutomaticallyRotateDeviceOrientation 功能,意味着所有的 UIViewController 都会被强制旋转设备方向。但其实某些情况下 UIViewController 并不会被当成一个完整的界面来使用,例如在浮层里、或者直接拿 vc.view 当成一个 subview 使用,这种情况下,这个 UIViewController 就不应该再具备“决定设备方向”的权利了,而目前 QMUI 的实现并没有考虑这种情况,于是会导致如果将一个 UIViewController 作为 QMUIModalPresentationViewController.contentViewController 使用,此时屏幕的方向应该由显示浮层的背后的界面决定,但最终却是由浮层里的 contentViewController 决定,这明显不符合预期。

@MoLice
Copy link
Collaborator Author

MoLice commented Mar 30, 2018

在 2.5.0 里我们修复了这个问题,关键代码在这里

@MoLice MoLice closed this as completed Mar 30, 2018
@MoLice MoLice added the bug label Apr 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant