在自定义键盘上反转键入字母

时间:2010-08-20 13:36:35

标签: ipad

每一个我都创建了波斯语自定义键盘。

我正在使用此代码:

NSString *text = textPad.text;
NSRange selectedRange = textPad.selectedRange;
text =  [text stringByReplacingCharactersInRange:selectedRange withString:@"A"];
textPad.text = text;
textPad.selectedRange = selectedRange;

但问题是用户输入单词时例如HELLO ...写道:OLLEH !!!!!!!角色写在最后一个角色后面,而不是在那之后!我的键盘是波斯语自定义键盘!

1 个答案:

答案 0 :(得分:1)

我应该更改你的slectedRange位置,在最后一个代码之前添加这段代码:

 selectedRange.location++;
相关问题