Home > Enterprise >  How do I hide the suggestion bar on iOS 15?
How do I hide the suggestion bar on iOS 15?

Time:03-23

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?

CodePudding user response:

I think you're missing spellCheckingType!

This works for me:

self.autocorrectionType = UITextAutocorrectionTypeNo;
self.spellCheckingType = UITextSpellCheckingTypeNo;
  • Related