の場合はinputView
を表示し、textfield
の場合はuipickerview
と表示しましたが、他の機能には同じtextfield
を使用します。 textfield
にinputView
を使用した後、標準キーボードを表示するにはどうすればよいですか?使用後にキーボードを表示する方法
textfield.inputView = pickrView;
の場合はinputView
を表示し、textfield
の場合はuipickerview
と表示しましたが、他の機能には同じtextfield
を使用します。 textfield
にinputView
を使用した後、標準キーボードを表示するにはどうすればよいですか?使用後にキーボードを表示する方法
textfield.inputView = pickrView;
ちょうど
textfield.inputView = nil;
は私のために働い
あなたはNOの代わりにnilまたはNULLを使うのがよいでしょう。 inputViewプロパティはBOOLではなくUIViewを必要とします。これはnilとしてNOで動作しますが、NOは両方とも数値0ですが、YESを指定すると失敗し、クラッシュします。 –
Ok ..ありがとう! –
それは私と一緒に働いていない:( – HusseinB
私は、このコードは多分パベルKaljunenが言ったように
[textField.inputView addTarget:self action:@selector(doTest) forControlEvents:UIControlEventTouchUpInside];
- (void)doTest
{
if([textFiled isFirstResponder])
{
[textFiled resignFirstResponder];
}
else
{
[textFiled becomeFirstResponder];
}
}
は、あなたがinputViewを設定するだけ働くことができると思いますキーボードはすでに表示されているときには、最初にresignする必要があります最初に、inputViewをnilに設定し、次にbecomeFirstResponderを再度設定します。
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.35];
[yourTextField resignFirstResponder];
yourTextField.inputView = nil;
[yourTextField becomeFirstResponder];
[UIView commitAnimations];
textfield.inputView = NO; –