Disable iOS8 Quicktype Keyboard programmatically on UITextView

后端 未结 6 764
被撕碎了的回忆
被撕碎了的回忆 2020-11-27 19:02

I\'m trying to update an app for iOS8, which has a chat interface, but the new Quicktype keyboard hides the text view, so I would like to turn it off programmatically or in

6条回答
  •  感动是毒
    2020-11-27 19:28

    As others have said, you can use:

    textView.autocorrectionType = .no
    

    but I've also noticed people struggling with actually making the autocomplete bar swap out, since if the textView is already the firstResponder when you change its autocorrectionType, it won't update the keyboard. Instead of trying to resign and reassign the firstResponder status to the textView to effect the change, you can simply call:

    textView.reloadInputViews()
    

    and that should hide the autocomplete bar. See https://developer.apple.com/documentation/uikit/uiresponder/1621110-reloadinputviews

提交回复
热议问题