菜鸟教程小白 发表于 2022-12-11 17:40:46

ios - 检查用户是否启用了自动更正 iOS


                                            <p><p>我有一个 UITextView,它的底部有其他 View 。启用自动更正后,我需要将 TextView 的内容向上移动,以便其他 View 不会覆盖小的自动更正窗口。但是,如果弹出窗口从未出现,则向上移动 View 看起来毫无意义。有什么建议么? </p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>您可以通过以下方式查看:</p>

<p><strong><em>Swift 2.2</em></strong></p>

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

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

<blockquote>
<p>//
// 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.
//</p>
</blockquote></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 检查用户是否启用了自动更正 iOS,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/39773145/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/39773145/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 检查用户是否启用了自动更正 iOS