Enable and Disable Keyboard return key on demand in iOS

戏子无情 提交于 2019-12-12 17:19:31

问题


I have a UITextField. While user is typing, I am using

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string

to validate the string. And if the string is valid I want to enable the return key; if it is not valid I want to disable the return key. Is there a way to do this?

For example the return key would be disabled while the user types the characters in avai. Then the return would become enabled after the user finishes typing avail. Then the return would be disabled again as user types availabl; then become enabled again as user types available.

来源:https://stackoverflow.com/questions/25728778/enable-and-disable-keyboard-return-key-on-demand-in-ios

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