Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show keyboard after used inputView

I used inputView to show uipickerview for my textfield, but I use same textfield for other functions. How can I show standard keyboard after I used inputView for that textfield?

textfield.inputView = pickrView;
like image 670
Pavel Kaljunen Avatar asked Jul 27 '12 22:07

Pavel Kaljunen


2 Answers

Just

textfield.inputView = nil;

worked for me

like image 195
Pavel Kaljunen Avatar answered Oct 04 '22 06:10

Pavel Kaljunen


As Pavel Kaljunen said, you need only to set the inputView to nil, but when the keyboard is already visible, you have to resignFirstResponder first, set the inputView to nil and then becomeFirstResponder again.

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.35];

[yourTextField resignFirstResponder];
yourTextField.inputView = nil;
[yourTextField becomeFirstResponder];

[UIView commitAnimations];
like image 32
MPajak Avatar answered Oct 04 '22 06:10

MPajak