Is there any way to disable predictive bar of keyboard in ios 8?
Asked Answered
G

4

6

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?

Gripper answered 23/9, 2014 at 11:47 Comment(0)
B
10

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.

Beira answered 23/9, 2014 at 11:54 Comment(1)
make sure to set the keyboard type to asciiCapable. Check this post, it is SwiftUI but it also applies to UIKitUndermanned
S
2

You can do it from the UI too. When selecting the text field element, change the Correction option to No

enter image description here

Slobber answered 19/1, 2015 at 20:35 Comment(0)
L
2
- (void)textFieldDidBeginEditing:(UITextField *)textField {

    UITextInputAssistantItem* item = [textField inputAssistantItem];
    item.leadingBarButtonGroups = @[];
    item.trailingBarButtonGroups = @[];
}

try this

Lam answered 1/10, 2015 at 8:4 Comment(0)
K
0

In later iOS versions only this worked for me:

searchBar.textContentType = UITextContentType(rawValue: "")
Kenwrick answered 23/12, 2020 at 12:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.