How do I get around my UITextField's HUGE auto-correct dismissal area?

拜拜、爱过 提交于 2019-12-11 17:45:04

问题


In my UITableView, each row has a text field or switch as its accessory view (a bit like the Settings app). The textFields are set with Auto-capitalisation ON. But the auto-correct prompt (the one you tap to dismiss the suggestion) seems to react to finger presses up to 65 px below the actual textField!

This means, for example, if a user types something in a textField, and then tries to press a UISwitch in the row below (without pressing return), instead of pressing the switch, their first press dismisses the autocorrect. For the user this is both confusing (they have to tap the switch twice) and annoying (they dismiss the text field's correction without meaning to).

Is there any way around this without having gigantic table rows or disabling autocomplete?


回答1:


Maybe you could have a timer of 1 or 2 seconds that check and resign the textfield automatically.



来源:https://stackoverflow.com/questions/5884852/how-do-i-get-around-my-uitextfields-huge-auto-correct-dismissal-area

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!