Reputation: 14622
How can I hide quicktype keyboard toolbar on iPad?
The following code doesn't work:
textField.autocorrectionType = UITextAutocorrectionTypeNo;
Upvotes: 8
Views: 3346
Reputation: 82759
place this code in viewDidLoad
yourTextFieldName.autocorrectionType = UITextAutocorrectionTypeNo;
UITextInputAssistantItem* shortcut = [yourTextFieldName inputAssistantItem];
shortcut.leadingBarButtonGroups = @[];
shortcut.trailingBarButtonGroups = @[];
Swift
yourTextFieldName.autocorrectionType = .No
let shortcut : UITextInputAssistantItem = yourTextFieldName.inputAssistantItem
shortcut.leadingBarButtonGroups = []
shortcut.trailingBarButtonGroups = []
swift3
yourTextFieldName.autocorrectionType = .no
var shortcut: UITextInputAssistantItem? = yourTextFieldName.inputAssistantItem()
shortcut?.leadingBarButtonGroups = []
shortcut?.trailingBarButtonGroups = []
for reference
Upvotes: 19
Reputation: 14622
To hide shortcuts altogether, set the leadingBarButtonGroups and trailingBarButtonGroups properties to nil. Doing so hides only the shortcuts and does not hide the typing suggestions. To hide typing suggestions, you must also set the autocorrectionType property of the responder that displays the keyboard to UITextAutocorrectionTypeNo.
<editorView>.autocorrectionType = UITextAutocorrectionTypeNo;
UITextInputAssistantItem* shortcut = [<editorView> inputAssistantItem];
shortcut.leadingBarButtonGroups = @[];
shortcut.trailingBarButtonGroups = @[];
Upvotes: 0
Reputation: 1063
How to hide the shortcut bar in iOS9
Have you tried this yet? What you do is simply disable the text proposals, not the undo / redo / paste ... thingies.
Upvotes: 1