有谁知道如何禁用 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
不采用布尔值作为参数。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)