简体   繁体   English

隐藏 iOS 键盘预测文本栏 - UITextView / UITextField

[英]Hide iOS Keyboard Predictive Text Bar - UITextView / UITextField

Seems that setting好像是这样设置

autocorrectionType = UITextAutocorrectionTypeNo;

for a UITextView or UITextField no longer sufficient to hide the iOS keyboard's predictive bar.对于UITextViewUITextField不再足以隐藏 iOS 键盘的预测栏。

Has Apple decides that this can only be hidden by the user in keyboard settings? Apple 是否决定这只能由用户在键盘设置中隐藏? Or this there still some way to do this programmatically?或者这还有一些方法可以以编程方式做到这一点? We need to do this for our app that includes spelling exercises.我们需要为包含拼写练习的应用程序执行此操作。

在此处输入图像描述

This removes the predictive text bar for me:这为我删除了预测文本栏:

@IBOutlet var tf: UITextField!

override func viewDidLoad() {
    super.viewDidLoad()
    tf.autocorrectionType = .no
    tf.spellCheckingType = .no
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM