如何在iOS中使用其他语言制作键盘 [英] how to make a keyboard in other language in iOS

查看:331
本文介绍了如何在iOS中使用其他语言制作键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个与iPhone键盘不同的高棉键盘。我该怎么办?

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

推荐答案

从iOS 4开始,UITextField和UITextView都有一个名为inputView的属性。它应该是一个能够接收点击并发送到保存文本字段的UIViewController的视图。因此,可以使用委托方法创建UIViewController,并将其视图设置为UITextField或UITextView的inputView。因此,假设MyCustomKeyboard是您的键盘的UIViewController,包括视图和委托方法,在视图控制器的viewDidLoad中,您应该放置:

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;

在视图控制器中,您可以处理MyCustomKeyboard类的委托方法。

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

如果您需要教程, Ray Wenderlich网站上有一个很好的网站,你应该做类似于iPhone的事情。

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

这篇关于如何在iOS中使用其他语言制作键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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