I'm creating the app in "Herbrew" language. (Language of IPhone can be anything, but my app runs only in Herbrew). In iOS for UIDatePicker, we have a property "locale" which will change the language that it is displaying. But in iOS5, the property is deprecated. How can I achieve it now?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Unfortunately, you cannot achieve this, not even with the calendar trick described by Martin Ulrich. I've struggled with the same problem myself and after a long research, I found out the bitter truth: the only way to change the localization of the UIDatePicker is to change the device's language.
If the user will have the app's language as Hebrew, everything will be alright. If not, there's nothing you can do, except maybe create your own date picker. Sorry
回答2:
You can set the calendar
property of the UIDatePicker to [NSCalendar currentCalendar]