开发者

UITextField Custom InputView - How do I get textFieldShouldReturn to fire?

I have created a custom inputView and have a Done button. Does anyone know how I can wire the done button up to work the same as a return key on the built in keyboard.

I basically need to get the textFieldShouldReturn method to fire for a UITextField.

I know I can call resignFirstResponder on the textfield, but this does not fire the textField开发者_Python百科ShouldReturn method.


If it's a custom input view, and a custom "Done" button, why do you need to use the text field delegate methods? You can wire the done button to your own action.

If you have some common code in your textFieldShouldReturn method this could be moved out to another method which can be called from the delegate method and your new action.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜