以前は自分のでinputView
表示していましたが、他の機能でも同じように使用しています。使用した後、標準のキーボードを表示するにはどうすればよいですか?uipickerview
textfield
textfield
inputView
textfield
textfield.inputView = pickrView;
以前は自分のでinputView
表示していましたが、他の機能でも同じように使用しています。使用した後、標準のキーボードを表示するにはどうすればよいですか?uipickerview
textfield
textfield
inputView
textfield
textfield.inputView = pickrView;
ただ
textfield.inputView = nil;
私のために働いた
Pavel Kaljunenが言ったように、inputViewをnilに設定するだけで済みますが、キーボードがすでに表示されている場合は、最初にresignFirstResponderを再署名し、inputViewをnilに設定してから、再びFirstResponderになる必要があります。
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.35];
[yourTextField resignFirstResponder];
yourTextField.inputView = nil;
[yourTextField becomeFirstResponder];
[UIView commitAnimations];
私はこのコードがおそらくうまくいくと思います
[textField.inputView addTarget:self action:@selector(doTest) forControlEvents:UIControlEventTouchUpInside];
- (void)doTest
{
if([textFiled isFirstResponder])
{
[textFiled resignFirstResponder];
}
else
{
[textFiled becomeFirstResponder];
}
}