UIDatePicker 改变 NSLocale 问题
UIDatePicker changing NSLocale Issue
希望每个人都做得很好。
我刚遇到一个奇怪的问题,手动更改 UIDatepicker 的 NSLocale 不起作用,但仅在特定模式下起作用
datePicker = [[UIDatePicker alloc] initWithFrame:CGRectMake(10, 130, [UIScreen mainScreen].bounds.size.width-20, 120)];
NSLocale* locale = [NSLocale localeWithLocaleIdentifier:[AppDelegate getLocale]];
[datePicker setLocale:locale];
datePicker.datePickerMode = UIDatePickerModeCountDownTimer;
现在这里只有 returns 小时和分钟的英语,与区域设置值无关,而如果您设置
datePicker.datePickerMode = UIDatePickerModeDate;
甚至这个
datePicker.datePickerMode = UIDatePickerModeTime;
工作正常
仅当您使用
datePicker.datePickerMode = UIDatePickerModeCountDownTimer;
locale 在这种情况下不起作用,
是否是 UIDatepicker 中的错误需要修复,或者有什么解决方法?
好吧,我从 APPle 那里得到了一个 Email/Answer,现在不可能,将来可能会。
Thanks for contacting to Apple’s Developer Technical Support.
When running in the count down mode, UIDatePicker showns the hours and minutes to count down. In this context, the “hours” and “minutes” are not a format, thus not covered by locale; rather, they are labels describing the meaning of the numbers, which honor to the application language. Note that locale is quite different from language. See WWDC 2014 Session 201 "Advanced Topics in Internationalization” for the details.
所以我们必须等到 Apple 修复它:( .
希望每个人都做得很好。
我刚遇到一个奇怪的问题,手动更改 UIDatepicker 的 NSLocale 不起作用,但仅在特定模式下起作用
datePicker = [[UIDatePicker alloc] initWithFrame:CGRectMake(10, 130, [UIScreen mainScreen].bounds.size.width-20, 120)];
NSLocale* locale = [NSLocale localeWithLocaleIdentifier:[AppDelegate getLocale]];
[datePicker setLocale:locale];
datePicker.datePickerMode = UIDatePickerModeCountDownTimer;
现在这里只有 returns 小时和分钟的英语,与区域设置值无关,而如果您设置
datePicker.datePickerMode = UIDatePickerModeDate;
甚至这个
datePicker.datePickerMode = UIDatePickerModeTime;
工作正常
仅当您使用
datePicker.datePickerMode = UIDatePickerModeCountDownTimer;
locale 在这种情况下不起作用,
是否是 UIDatepicker 中的错误需要修复,或者有什么解决方法?
好吧,我从 APPle 那里得到了一个 Email/Answer,现在不可能,将来可能会。
Thanks for contacting to Apple’s Developer Technical Support.
When running in the count down mode, UIDatePicker showns the hours and minutes to count down. In this context, the “hours” and “minutes” are not a format, thus not covered by locale; rather, they are labels describing the meaning of the numbers, which honor to the application language. Note that locale is quite different from language. See WWDC 2014 Session 201 "Advanced Topics in Internationalization” for the details.
所以我们必须等到 Apple 修复它:( .