有谁知道如何禁用uitextview中的自动更正编程?我有以下代码,但不起作用。
- (void)_setUpTextView {
self.textView = [[UITextView alloc] initWithFrame:self.bounds];
self.textView.accessibilityLabel = @"CommentTextView";
self.textView.translatesAutoresizingMaskIntoConstraints = NO;
[self.textView setFont:[[AppearanceManager sharedManager] brightenFontWithSize:26.0f]];
[self.textView.layer setCornerRadius:5.0f];
self.textView.delegate = self;
self.textView.autocorrectionType = FALSE; // or use UITextAutocorrectionTypeNo
self.textView.autocapitalizationType = UITextAutocapitalizationTypeNone;
[self addSubview:self.textView];
}
哇,哥们,您评论了自己的答案。进行以下更改:
self.textView.autocorrectionType = UITextAutocorrectionTypeNo;
而且您应该很好。autoCorrectionType
不接受布尔值作为参数。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句