0

I have on OpenGL window that is also used for text input when a text element is clicked in our engine

@interface MyGLView : UIView <UIKeyInput, UITextInput, UITextInputTraits>

Whenever this view becomes first responder, it shows the suggestion bar above the keyboard. On many devices, this covers a very large portion of the screen and makes it hard to lay out the UI.

keyboard

I have read that the following code is supposed to hide this suggestion bar, but nothing I change seems to have any affect

self.autocorrectionType = UITextAutocorrectionTypeNo;
self.inputAssistantItem.leadingBarButtonGroups = @[];
self.inputAssistantItem.trailingBarButtonGroups = @[];

I have tried putting this in the init for the view as well as in becomeFirstResponder method, but both don't seem to matter. What is the proper way to do this?

David
  • 1,648
  • 1
  • 16
  • 31
  • 1
    Does this answer your question? [iOS 8 - How to hide suggestion list above keyboard?](https://stackoverflow.com/questions/24140116/ios-8-how-to-hide-suggestion-list-above-keyboard) – Ptit Xav Mar 01 '22 at 10:37
  • @PtitXav - No, because I tried this already. It did point out the fact that I copied one wrong line of code in my original question, so I have corrected this. Thanks! – David Mar 01 '22 at 20:39

1 Answers1

1

I think you're missing spellCheckingType!

This works for me:

self.autocorrectionType = UITextAutocorrectionTypeNo;
self.spellCheckingType = UITextSpellCheckingTypeNo;
Mateus
  • 2,640
  • 5
  • 44
  • 62
  • Thanks, this worked! I had to implement the property first as its optional to the protocol, but then it removed the bar! – David Mar 22 '22 at 19:26