iOS9: UIDatePicker with datePickerMode of UIDatePickerModeTime only shows Hours, and no Minutes

后端 未结 6 1772
暗喜
暗喜 2021-02-14 07:13

I\'m using Xcode beta 7 with the iOS9 simulator. Using a UIDatePicker with a datePickerMode of UIDatePickerModeTime only shows Hours, and not minutes.

See screenshot:

6条回答
  •  不思量自难忘°
    2021-02-14 07:59

    I encountered this after the public release of iOS 9.0 with a UIDatePicker using UIDatePickerModeDate in my tableview.

    I hacked around it by changing the UIDatePicker mode right before it was displayed, and then changing it back to the desired one:

    [myDatePicker setDatePickerMode:UIDatePickerModeDateAndTime];
    [myDatePicker setDatePickerMode:UIDatePickerModeDate];
    

    I'm guessing redrawing it solves the issue. For interest's sake I don't think it's actually an issue of not displaying the minutes but rather a bug in the subviews because this is what mine looked like:

    Inspecting using FLEX, this is part of the UIDatePicker that has a solid white background.

提交回复
热议问题