iPhone - UITextField 中的中文和日文
我想确保我编写的一些代码可以很好地处理中文和日文字符。我尝试将 iPhone Simulator 语言更改为中文和日语,但 UITextFields 的字符集似乎没有更改。你是怎么做到的?
I want to make sure some code I've written works well with Chinese and Japanese characters. I tried changing the iPhone Simulator language to Chinese and Japanese, but it doesn't look like the character set for the UITextFields change. How do you do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我遇到了相同(或类似)的问题(
UITextField
中没有出现中文/日文键盘,即使它们在设置中启用,而其他键盘(例如法语)却出现了)。最终我发现我已将
KeyboardType
属性设置为UIKeyboardTypeAlphabet
。注释掉这一行会导致非拉丁键盘按预期显示。I have come across the same (or similar) issue (chinese/japanese keyboards do not appear for
UITextField
even though they are enabled in settings whilst others, such as french, do appear).Eventually I discovered that I had set the
KeyboardType
property toUIKeyboardTypeAlphabet
. Commenting out this line caused the non-latin keyboards to show as expected.转到设置>一般>国际>键盘以启用日语键盘。
Go to Settings > General > International > Keyboards to enable the Japanese keyboard.