diff --git a/iphone/Maps/UI/Search/DatePickerViewController.swift b/iphone/Maps/UI/Search/DatePickerViewController.swift index 8278ac1478..3dbe8b5261 100644 --- a/iphone/Maps/UI/Search/DatePickerViewController.swift +++ b/iphone/Maps/UI/Search/DatePickerViewController.swift @@ -8,7 +8,8 @@ import UIKit } @objc final class DatePickerViewController: UIViewController { - private let transitioning = CoverVerticalModalTransitioning(presentationHeight: 550) + private static let kHeight: CGFloat = 550 + private let transitioning = CoverVerticalModalTransitioning(presentationHeight: min(UIScreen.main.bounds.height, kHeight)) @IBOutlet var checkInLabel: UILabel! @IBOutlet var startDateLabel: UILabel! @@ -59,6 +60,16 @@ import UIKit @IBAction func onCancel(_ sender: UIButton) { delegate?.datePickerDidCancel(self) } + + override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { + super.traitCollectionDidChange(previousTraitCollection) + alternativeSizeClass(iPhone: { + if let superview = view.superview { + view.height = min(UIScreen.main.bounds.height, DatePickerViewController.kHeight) + view.minY = superview.height - view.height + } + }, iPad: {}) + } } extension DatePickerViewController: DatePickerViewDelegate { diff --git a/iphone/Maps/UI/Search/DatePickerViewController.xib b/iphone/Maps/UI/Search/DatePickerViewController.xib index f9a4db6947..833f633006 100644 --- a/iphone/Maps/UI/Search/DatePickerViewController.xib +++ b/iphone/Maps/UI/Search/DatePickerViewController.xib @@ -1,9 +1,9 @@ - + - + @@ -22,11 +22,18 @@ - + + + + + + + + - + @@ -131,10 +138,10 @@ - + - + @@ -150,7 +157,7 @@ - +