how to make a keyboard in other language in iOS

风流意气都作罢 提交于 2019-12-20 02:57:21

问题


I want to create a khmer keyboard which is different from iPhone keyboard. How can I do that ?


回答1:


Unfortunately, you cannot control the language of the keyboard. The user chooses which keyboards they would like available via the settings application and can toggle between them using the globe icon on the keyboard. When the keyboard is opened it will open to the most recently used keyboard.




回答2:


make a customize keyboard. take a UIView add UIButton and add what you want to all in this view.




回答3:


Starting from iOS 4, UITextField and UITextView have a property called inputView. It should be a view able to receive the taps and send to the UIViewController that holds your text field. So, can create a UIViewController with delegate methods, and set it's view as the inputView of your UITextField or UITextView. So, assuming that MyCustomKeyboard is the UIViewController that is your keyboard, including the view and the delegate methods, in your viewDidLoad of your view controller, you should put:

MyCustomKeyboard *customKeyboard = [[MyCustomKeyboard alloc] init];
customKeyboard.delegate = self;
myTextField.inputView = customKeyboard.view;

And in your view controller you handle the delegate methods of your MyCustomKeyboard class.

If you want a tutorial, there is a good one in Ray Wenderlich website, you should do something similar to the iPhone.




回答4:


I don't think it can be done just for one app, two options:

  • The user has to change to the correct language.

Since that is not what you want, there is option 2:

  • Implement your own keyboard (=huge amount of work)


来源:https://stackoverflow.com/questions/12192818/how-to-make-a-keyboard-in-other-language-in-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!