禁用自动更正的UITextView [英] Disable autocorrect UITextView
本文介绍了禁用自动更正的UITextView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人知道如何在uitextview中禁用自动更正编程吗?我有以下代码,但不起作用.
Does anyone know how to disable autocorrect programming in uitextview? I have the following code, but it doesn't work.
- (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];
}
推荐答案
哇,哥们,您注释掉了自己的答案.进行更改:
Whoa there buddy, you commented out your own answer. Make this change:
self.textView.autocorrectionType = UITextAutocorrectionTypeNo;
您应该很好. autoCorrectionType
不将布尔值作为参数.
And you should be good to go. autoCorrectionType
does not take a boolean as an argument.
这篇关于禁用自动更正的UITextView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文