iOS - 按区域设置更改UIDatePicker的语言 [英] iOS - Change Language for UIDatePicker by locale

查看:337
本文介绍了iOS - 按区域设置更改UIDatePicker的语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用希伯来语创建应用程序。 (iPhone的语言可以是任何东西,但我的应用程序仅在希伯来语中运行)。
在UIDatePicker的iOS中,我们有一个属性locale,它将改变它显示的语言。但在iOS5中,该属性已被弃用。我现在该如何实现呢?

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?

推荐答案

不幸的是,即使是马丁·乌尔里希描述的日历技巧,你也无法做到这一点。
我自己也遇到了同样的问题,经过长时间的研究,我发现了一个痛苦的事实:改变UIDatePicker本地化的唯一方法就是改变设备的语言。

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

这篇关于iOS - 按区域设置更改UIDatePicker的语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆