I have no problem doing autolayout on buttons and labels, but I am having a hard time doing autolayout with the UIDatePicker.
Asked
Active
Viewed 197 times
0
-
What is the problem you faced? – vien vu Dec 14 '15 at 01:25
-
check the answers in this http://stackoverflow.com/questions/31769479/datepicker-is-incorrect-in-ios9 – Karlos Dec 14 '15 at 04:51
-
my problem is that in landscape mode the date picker doesn't fit to the screen. This link shows how to do it in objective C, http://stackoverflow.com/questions/2331752/iphone-uidatepicker-in-landscape-mode. Could someone translate this code to swift2 code for me please? – user2016535 Dec 14 '15 at 18:59
-
`override func viewDidLoad() { super.viewDidLoad() for subview: UIView in datePicker.subviews { subview.frame = datePicker.bounds } }` [Converter](https://objectivec2swift.com/#/converter/code) – Pranav Wadhwa Dec 14 '15 at 21:25
-
I used that code and I'm having the same problem in landscape view the date picker doesn't take up the whole screen – user2016535 Dec 14 '15 at 22:33