最終更新:2017-07-26 (水) 05:40:54 (2466d)  

UIKit/キーボード
Top / UIKit / キーボード

UITextFieldでリターンキーを押したときの動作

UITextFieldDelegate textFieldShouldReturn:がreturn YESのとき

  • されている
  • されていない

UITextFieldDelegate textFieldShouldReturn:がreturn NOのとき

  • なにもおきない

メモ

他のボタンを押すと閉じるようにする

[textField endEditing:YES];

通知

  • When the system shows or hides the keyboard, it posts several keyboard notifications. These notifications contain information about the keyboard, including its size, which you can use for calculations that involve moving views. Registering for these notifications is the only way to get some types of information about the keyboard. The system delivers the following notifications for keyboard-related events:
  • UIKeyboardWillShowNotification?
  • UIKeyboardDidShowNotification?
  • UIKeyboardWillHideNotification?
  • UIKeyboardDidHideNotification?

endEditing?

表示

参考