如果从设备中的键盘设置关闭文本预测,UITextView inputAccessoryView 不会显示

UITextView’s inputAccessoryView does not show up, if text predictions are turned off from keyboard settings in device

我正在开发一个聊天应用程序,其中文本视图放置在 Viewcontroller 中,就像 Whatsapp 一样。 TextView 在上面移动,连同键盘完全像 whatsapp。

我需要在键盘和文本视图之间显示一个包含一些按钮的工具栏。 它是通过创建一个工具栏并将其分配给 UITEXTVIEW 的 INPUTACCESSORYVIEW 来完成的。 除非用户如下更改设备设置,否则它会完美运行。

设置 —> 通用 —> 键盘 —> 预测(关闭)。

按上述方法更改键盘设置后。一个空的 space 出现在 inputAccessoryView 的位置。

我找不到与此问题类似的问题。

我们将不胜感激任何形式的帮助。

Often while developing an app, We ran into an issues where the iPhone keyboard slide up and cover the UITextField/UITextView. IQKeyboardManager allows you to prevent issues of the keyboard sliding up and cover UITextField/UITextView without needing you to enter any code and no additional setup required. To use IQKeyboardManager you simply need to add source files to your project.

所以我推荐你使用IQKeyboardManager