So we have predictive bar in iOS 8 but it covers my input field above the keyboard. I found only one solution to hide it by setting correction of textView to NO. But it turns off correction as well which is not good.Any suggestions?Is there any api for this stuff from Apple?
Is there any way to disable predictive bar of keyboard in ios 8?
Asked Answered
Setting autocorrectionType
to UITextAutocorrectionTypeNo
on the UITextView in question (or correction to NO in IB) disables autocorrect as well as the predictive text bar in iOS 8. There doesn't appear to be a way to disable just the predictive bar however.
make sure to set the keyboard type to asciiCapable. Check this post, it is SwiftUI but it also applies to UIKit –
Undermanned
You can do it from the UI too. When selecting the text field element, change the Correction option to No
- (void)textFieldDidBeginEditing:(UITextField *)textField {
UITextInputAssistantItem* item = [textField inputAssistantItem];
item.leadingBarButtonGroups = @[];
item.trailingBarButtonGroups = @[];
}
try this
In later iOS versions only this worked for me:
searchBar.textContentType = UITextContentType(rawValue: "")
© 2022 - 2024 — McMap. All rights reserved.