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

后端 未结 6 1188
天命终不由人
天命终不由人 2021-02-14 07:39

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 08:08

    On iPhone 5S iOS 9.1 my month names are truncated when I display the UIDatePicker. I fixed this problem by setting a local property as follows:

    NSLocale *uk = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];
    NSCalendar *cal = [NSCalendar currentCalendar];
    [cal setLocale:uk];
    [_backdateDatePicker setCalendar:cal];
    

提交回复
热议问题