【发布时间】:2013-11-19 16:50:30
【问题描述】:
我有一个 UITextView,我希望能够为其切换 autocorrectionType。
像这样简单地切换 autocorrectionType 是行不通的。
myTextView.autocorrectionType = UITextAutocorrectionTypeYes;
myTextView.autocorrectionType = UITextAutocorrectionTypeNo;
我用过
myTextView.text = myTextView.text;
和
[myTextView insertText:@" "];
[myTextView deleteBackward];
和
[myTextView setNeedsDisplay];
这些都不起作用...
【问题讨论】:
-
你能解释一下你说“它不起作用”是什么意思吗?它做了什么,你期望它做什么。
-
当 UITextAutocorrectionTypeNo 文本停留在带有下划线的红点...我想删除它.. 我也在做这个 textContainerView.autocorrectionType=UITextAutocorrectionTypeNo; textContainerView.spellCheckingType=UITextSpellCheckingTypeNo;
-
你写的第一段代码是正确的。这听起来更像是你把它放在哪里的问题。
标签: ios objective-c uitextview autocorrect