开发者

How to know the pressed key in the keyboard in iPhone

I am new to iPhone. I'd like to know the key pressed in the keyboard, and instead of the letter of the key I'd like to insert another letter in UITextView.

So for this are there any methods which will be called when a key is pressed in the key board and the methods in which we can change the letter of that key, which will be written to the UITextView ?

Thanks i开发者_JS百科n advance.


The UITextViewDelegate Protocol provides a way of intercepting characters as the are typed using:

- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text

at this point you can return NO and do your own text replacement.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜