开发者

iphone uidatepicker localization

I facing a problem with localization in iphone date picker.I want the date picker to show dates only in English, but now it takes the language which is set to the region in iphone settings.I tried various things which was not useful like the below.

  1. setting the locale setting in the nib file of the uidatepicker.
  2. setting the locale through code

    NSLocale* locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_GB"];
    [datePicker setLocale:locale]开发者_高级运维;
    [datePicker setCalendar:[locale objectForKey:NSLocaleCalendar]];
    

This did not work.If any one has good ideas to resolve the issue please help


I think this is a known issue. The date picker seems to rely on the current user's country settings which you cannot change from code. In fact, I don't know what the locale property is there for. It simply does nothing.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜