2

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.

enter image description here

Can someone help me out? Tks.

Chris Stillwell
  • 10,266
  • 10
  • 67
  • 77
Râmede Bento
  • 21
  • 1
  • 5
  • 2
    That isn't natural for an iOS keyboard, you must be adding that bar to the keyboard.. right? – MSU_Bulldog Apr 01 '16 at 20:15
  • 1
    Show what you did to display this top bar? – shpasta Apr 01 '16 at 22:17
  • http://stackoverflow.com/a/26500983/653513 – Rok Jarc Apr 02 '16 at 05:40
  • 1
    Thank you, @MSU_Bulldog and @shpasta! I was continue the developing a iOS app and i'm complete new :( So i checked the project and saw it uses the [IQKeyboardManager](https://github.com/hackiftekhar/IQKeyboardManager). To disable the bar was need set a property like this: textField.inputAccessoryView = [[UIView alloc] init]; – Râmede Bento May 25 '16 at 12:53

3 Answers3

3

Try this,

YourTextField.autocorrectionType = UITextAutocorrectionTypeNo;
Manikandan D
  • 1,422
  • 1
  • 13
  • 25
  • This will remove the view that bottom of marked rectangle in above picture, he wants remove `inputAccessoryview` not autoCorrection view – Coder ACJHP May 20 '22 at 11:38
3

If your project is using IQKeyboardManager, then to get rid of that top bar, you can use IQKeyboardManager.shared().disabledToolbarClasses.add(YourViewController.self)

Ali
  • 2,427
  • 22
  • 25
  • 3
    It is `IQKeyboardManager.shared.disabledToolbarClasses.append(YourViewController.self)` in IQKeyboardManagerSwift v6.4.2 – giorgos.nl Oct 23 '19 at 09:13
2

remove inputAccessoryView from your UITextField

yourTextField.inputAccessoryview = nil
Mathews
  • 733
  • 5
  • 11