我在customView中使用UITextInput:
MyCode:https://github.com/lequysang/github_zip/blob/master/UITextInputDebug.zip
@property (strong,nonatomic) id<UITextInput> textInput;在输入一些字符后,我想返回4个字符,并替换此位置的文本(将任何字符替换为T).Current光标的末尾。
如何做到这一点?
我尝试了replaceRange和UITextRange,但不知道如何获得它的位置和大小!
请帮帮我!提前感谢!
发布于 2013-03-18 11:05:39
replaceRange:withText:替换指定范围内的文档中的文本。(必填)
- (void)replaceRange:(UITextRange *)range withText:(NSString *)text参数
range文档中的文本范围。
text替换range中的文本的字符串。
Availability在iOS 3.2及更高版本中提供。
另请参阅
– textInRange: 在UITextInput.h中声明
https://stackoverflow.com/questions/15468983
复制相似问题