Overloading the IPhone “GO” button to perform an a

2019-06-27 19:41发布

I am designing an application using html and javascript. I have a login form with a Login button on it. A textfield accepts a username and then pressing the login button, login action takes place. However, what i want to do now is that while using the virtual keypad in IPhone, clicking the GO button must initiate the Login action too. Please let me know the solution for the same. Thanks.

1条回答
聊天终结者
2楼-- · 2019-06-27 19:58

Set a delegate object (point to your view controller) for your UITextField and use the method

- (BOOL)textFieldShouldReturn:(UITextField *)textField

-textFieldShouldReturn will be called just before the user the user taps the "Go" or "Return". Remember to return "YES".

查看更多
登录 后发表回答