how to popup default iphone keyboard on a button click

﹥>﹥吖頭↗ 提交于 2019-12-12 10:55:12

问题


Hi When we click on a UITextField or UITextView, a default keyboard pops up from the bottom of iphone screen. I want iphone keyboard to appear on a button click, and then handle the keys as typed on keyboard... How can i do that?


回答1:


Add touchupinside event on button and call becomeFirstResponder method for textview or textfield it will call pop up keyboard. see the following code-

-(IBAction)buttonClicktoModalView:(id)sender{
[textView becomeFirstResponder];
}



回答2:


I was searching my problem, and came across the following stackoverflow link which answers my question

How to pull up a UIKeyboard without a UITextField or UITextView?

Thank you




回答3:


Pls go through this

iphone keyboard without textview

Hope this helps



来源:https://stackoverflow.com/questions/5216944/how-to-popup-default-iphone-keyboard-on-a-button-click

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