blank UIDatePicker on iPad in mode UIDatePickerModeDateAndTime

五迷三道 提交于 2019-12-02 02:08:52

I implemented the work-around for this issue: setting the dtVCpicker.date inside the viewDidLoad made the Picker displayable.


In my existing code, I just added the picker inside a Popup, and so viewDidLoad wasn't called when the Popup displays. So I created a view that contains the picker, and put the view inside the Popup (and put the setDate in the viewDidLoad). It works.

The problem is with the line:

dtVCpicker.date = [NSDate date];

This causes the UIDatePicker with UIDatePickerModeDateAndTime to break (probably a bug). However, this line is needless, since the date picker is by default set to current date.

To sum up, in my code I simply solve the issue by removing the above line. Of course, it is still possible to set the date of the picker, but in the other method.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!