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
OverlayContainerSheetPresentationController
doesn't update view frame when device is rotated
#67
Comments
Seems the problem is more related with Because, I've tried to present |
That's interesting! Thanks. I tried to reproduce the bug without any overlay container code: class ViewController: UIViewController {
private lazy var button = UIButton(type: .system)
// MARK: - UIViewController
override func viewDidLoad() {
super.viewDidLoad()
setUp()
}
// MARK: - Private
@objc private func buttonAction(_ sender: UIButton) {
let container = ColoredViewController()
container.modalPresentationStyle = .overCurrentContext
present(container, animated: true, completion: nil)
}
private func setUp() {
view.addSubview(button)
button.setTitle("Show", for: .normal)
button.translatesAutoresizingMaskIntoConstraints = false
button.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
button.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
button.addTarget(self, action: #selector(buttonAction(_:)), for: .touchUpInside)
}
} I found out the default let container = OverlayContainerViewController()
container.view.autoresizingMask = [.flexibleHeight, .flexibleWidth]
container.modalPresentationStyle = .overCurrentContext
present(container, animated: true, completion: nil) |
Thanks, this fixed the issue. It seems by default I think we could do the same thing on |
You are right. My class ColoredViewController: UIViewController {
override func loadView() {
view = UIView()
view.backgroundColor = .systemBlue
}
} If I use a pure empty view controller instead, it works correctly. let vc = UIViewController()
vc.view.backgroundColor = .systemBlue I will change the mask in the next release. Thanks! |
Describe the bug
OverlayContainerSheetPresentationController
doesn't respect device orientation changes and doesn't update the presented view controller's viewExpected behavior
OverlayContainerSheetPresentationController
will update its content view within the device rotation animationScreenshots, videos or sample codes
video demo.mp4.zip
Environnement :
The text was updated successfully, but these errors were encountered: