简体   繁体   English

如何检测UITextView的自动更正状态?

[英]How to detect autocorrect state of UITextView?

How can I tell whether UITextView is in autocorrecting state? 如何判断UITextView是否处于自动更正状态? That is, the incorrect or incomplete part is highlighted and the candidate is popped up. 也就是说,不正确或不完整的部分将突出显示,并弹出候选人。

Neither selectedRange nor markedTextRange is useful for this. selectedRangemarkedTextRange都不有用。

I suppose you could force the autocorrect to be applied and then check to see if there are any changes (a modified version of this answer: https://stackoverflow.com/a/13012198/953105 ), however that will destroy the autocorrect suggestion. 我想您可以强制应用自动更正,然后检查是否有任何更改(此答案的修改版本: https : //stackoverflow.com/a/13012198/953105 ),但是这会破坏自动更正的建议。 I'm not sure of your use case, but that could work. 我不确定您的用例,但可以使用。

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

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