I'm a beginner ios developer. I'm trying hide "shortcut keyboard bar" on iOS keyboard with unsuccessful. Bellow is my code:
- (void)textFieldDidBeginEditing:(UITextField*)textField {
UITextInputAssistantItem* item = [textField inputAssistantItem];
item.leadingBarButtonGroups = @[];
item.trailingBarButtonGroups = @[];
}
I did hide the assistant bar buttons with setting autocorretionType, but the top bar with action button (ok, done, ...) don't hide.
Can someone help me out? Tks.
如果您的项目使用IQKeyboardManager
,那么要摆脱顶部栏,您可以使用IQKeyboardManager.shared().disabledToolbarClasses.add(YourViewController.self)
试试这个,
YourTextField.autocorrectionType = UITextAutocorrectionTypeNo;
从您的UITextField
删除inputAccessoryView
yourTextField.inputAccessoryview = nil
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.