I want to show the keyboard just after a view controller is being pushed to start editing a specific UITextField.
I believe that I should manually fire the event on the ViewDidAppear.
Which is the proper way of doing such tasks?
I want to show the keyboard just after a view controller is being pushed to start editing a specific UITextField.
I believe that I should manually fire the event on the ViewDidAppear.
Which is the proper way of doing such tasks?
キーボードを表示するには、テキストフィールドをファーストレスポンダーとして手動で設定する必要があります。
[textFieldbecomeFirstResponder];
viewWillAppear:
これは、メソッド内またはメソッド内のいずれかで呼び出すことができviewDidAppear:
ます。どちらかが最適な動作を提供します。
そのためにあなたが必要IBOutlet UITextFiled *yourTextField;
- (void)viewDidLoad or viewWillAppear:(BOOL)animated or viewDidAppear:(BOOL)animated
{
[yourTextField becomeFirstResponder];
}