質問

I would like to know if you can call the return (enter) key of the UIkeyboard programmatically. I have created a paste method which pastes a cached value into a UITextField, what I want to do then is go to the next UITextField.

I can do this if I hit the enter key on the UIkeyboard I was woundering if I can programmatically use the enter key.

役に立ちましたか?

解決

Why not use UIResponder to jump to the next text field? https://developer.apple.com/library/ios/documentation/uikit/reference/UIResponder_Class/Reference/Reference.html

As to simulate key press, his might help http://blog.lazerwalker.com/blog/2013/10/17/more-fun-with-simulated-ios-events-keypresses/ But he uses private apis, and it only works before iOS7.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top