OGeek|极客世界-中国程序员成长平台

标题: ios - 检查用户是否启用了自动更正 iOS [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 17:40
标题: ios - 检查用户是否启用了自动更正 iOS

我有一个 UITextView,它的底部有其他 View 。启用自动更正后,我需要将 TextView 的内容向上移动,以便其他 View 不会覆盖小的自动更正窗口。但是,如果弹出窗口从未出现,则向上移动 View 看起来毫无意义。有什么建议么?



Best Answer-推荐答案


您可以通过以下方式查看:

Swift 2.2

if textField.autocorrectionType == .Yes {
 //do some stuff when auto correction is enabled
}

UITextField 有一个与 UITextAutoCorrectionType 枚举相关的属性 autocorrectionType。 Apple关于它的文档:

// // UITextAutocorrectionType // // Controls keyboard autocorrection behavior for a text widget. // Note: Some input methods do not support inline autocorrection, and // instead use a conversion and/or candidate selection methodology. In such // cases, these values are ignored by the keyboard/input method implementation. //

关于ios - 检查用户是否启用了自动更正 iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39773145/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4