With the release of iOS 8 I would like to disable the predictive text section of the keyboard when I begin typing in a UITextField. Not sure how this is done, any help would be appreciated!
问题:
回答1:
Setting the autoCorrectionType to UITextAutocorrectionTypeNo did the trick
Objective-C
textField.autocorrectionType = UITextAutocorrectionTypeYes;
textField.autocorrectionType = UITextAutocorrectionTypeNo;
Swift 2
textField.autocorrectionType = .Yes
textField.autocorrectionType = .No
Swift 3
textField.autocorrectionType = .yes
textField.autocorrectionType = .no
回答2:
Swift 2
textField.autocorrectionType = .Yes
textField.autocorrectionType = .No
Swift 3
textField.autocorrectionType = .yes
textField.autocorrectionType = .no
回答3:
like this you on or off UITextAutocorrectionType
myTextView.autocorrectionType = UITextAutocorrectionTypeNo;
myTextView.autocorrectionType = UITextAutocorrectionTypeYes;
回答4:
The chosen answer is correct, but you also have an option to do the same in storyboard.
All you need is to select your textfield and under "show the Attributes inspector" set Correction to NO. Check attached image.
See attached image
回答5:
FIXED for SWIFT-3:
myTextField.autocorrectionType = .no
回答6:
Setting autocorrectionType to .no allowed my tableview to scroll to the last entry. With predictive text on the last line was blocked from being selected.
回答7:
Tap and hold the language key (the one that looks like a globe or possibly an Emoji smile face) and set the toggle for "Predictive" to off.