3
我编程方式创建的UIDatePicker,并用下面的代码设置其区域:UIDatePicker区域设置什么也不做?
datePicker.locale = [[[NSLocale alloc] initWithLocaleIdentifier:@"es_ES"] autorelease];
的日期选择器仍然会出现在英语(或其他语言我已经设置手机)。任何人都知道为什么这不起作用,或者如何解决它?
我编程方式创建的UIDatePicker,并用下面的代码设置其区域:UIDatePicker区域设置什么也不做?
datePicker.locale = [[[NSLocale alloc] initWithLocaleIdentifier:@"es_ES"] autorelease];
的日期选择器仍然会出现在英语(或其他语言我已经设置手机)。任何人都知道为什么这不起作用,或者如何解决它?
作为回答这里Can I localize a UIDatePicker?,拣货机显示取决于国家设置,而不是语言设置。
在您的示例中,您只是更改语言区域设置。
尝试改变的UIDatePicker的日历的语言环境,以及:
NSLocale *locale = [[[NSLocale alloc] initWithLocaleIdentifier:@"es_ES"] autorelease];
datePicker.locale = locale;
datePicker.calendar = [locale objectForKey:NSLocaleCalendar];
不幸的是,没有什么。 – Julian 2012-08-27 23:50:26