I have a button that inserts a character into a UITextView. I want this button to behave as the spacebar button does; I want the pending autocorrect suggestion to be accepted upon pressing it.
Can this be done? If so, how? Thanks!
I have a button that inserts a character into a UITextView. I want this button to behave as the spacebar button does; I want the pending autocorrect suggestion to be accepted upon pressing it.
Can this be done? If so, how? Thanks!
これを行う(アニメーションを殺す)代わりに、次を使用できることがわかりました。
[messageField reloadInputViews];
魅力のように機能します。
オートコレクトと直接対話するAPIはありません。ただし、少し前に遭遇したハックがあります。レスポンダーを辞任すると、現在表示されているオートコレクトが受け入れられます。したがって、最初のレスポンダーを辞任してから再度割り当てることで解決できる場合があります。
[myTextView resignFirstResponder];
[myTextView becomeFirstResponder];