how to popup default iphone keyboard on a button c

2019-06-23 05:06发布

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?

3条回答
Deceive 欺骗
2楼-- · 2019-06-23 05:44

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];
}
查看更多
叼着烟拽天下
3楼-- · 2019-06-23 05:55

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

查看更多
冷血范
4楼-- · 2019-06-23 06:10

Pls go through this

iphone keyboard without textview

Hope this helps

查看更多
登录 后发表回答