PanModal Portrait to Landscape Issue (#53)
* Fix issue where transitioning from portrait to landscape would cause a PanModal's view to disappear if its height was short * improve transitioning to landscape fix
This commit is contained in:
parent
6b1edd1dfb
commit
9d73db3919
|
|
@ -226,7 +226,6 @@ public class PanModalPresentationController: UIPresentationController {
|
|||
else { return }
|
||||
|
||||
self.adjustPresentedViewFrame()
|
||||
|
||||
if presentable.shouldRoundTopCorners {
|
||||
self.addRoundedCorners(to: self.presentedView)
|
||||
}
|
||||
|
|
@ -367,7 +366,13 @@ private extension PanModalPresentationController {
|
|||
else { return }
|
||||
|
||||
let adjustedSize = CGSize(width: frame.size.width, height: frame.size.height - anchoredYPosition)
|
||||
let panFrame = panContainerView.frame
|
||||
panContainerView.frame.size = frame.size
|
||||
|
||||
if ![shortFormYPosition, longFormYPosition].contains(panFrame.origin.y) {
|
||||
adjust(toYPosition: panFrame.origin.y - panFrame.height + frame.height)
|
||||
}
|
||||
panContainerView.frame.origin.x = frame.origin.x
|
||||
presentedViewController.view.frame = CGRect(origin: .zero, size: adjustedSize)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue