简体   繁体   中英

How can I hide quicktype keyboard toolbar on iPad?

How can I hide quicktype keyboard toolbar on iPad?

在此输入图像描述

The following code doesn't work:

textField.autocorrectionType = UITextAutocorrectionTypeNo;

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

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.

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 = @[];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM