【发布时间】:2015-04-17 02:23:20
【问题描述】:
有谁知道如何在 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];
}
【问题讨论】:
-
FALSE不是autocorrectionType。为什么要评论UITextAutocorrectionTypeNo? -
那是我的错误。谢谢!我正在使用别人代码中的代码片段,这对我来说非常愚蠢。
标签: objective-c uitextview autocorrect