How to show keyboard after using inputView

I used inputViewto show uipickerviewfor mine textfield, but I use the same textfieldfor other functions. How can I show a standard keyboard after I used inputViewto do this textfield?

textfield.inputView = pickrView;
+5
source share
3 answers

Simply

textfield.inputView = nil;

worked for me

+10
source

As Pavel Kaljunen said, you only need to set the inputView to zero, but when the keyboard is already visible, you first need to run the resignFirstResponder command, set the inputView to zero, and then run FirstResponder again.

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

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

[UIView commitAnimations];
+3
source

,

 [textField.inputView addTarget:self action:@selector(doTest) forControlEvents:UIControlEventTouchUpInside];

- (void)doTest
{
  if([textFiled isFirstResponder])
  {
    [textFiled resignFirstResponder];
  }
  else
  {
    [textFiled becomeFirstResponder];
  }
}
0
source

All Articles