LoginSignup
8
7

More than 5 years have passed since last update.

UITextViewでフォーカスが外れた時キーボードを隠す

Last updated at Posted at 2014-03-22

簡単なことのようだけどよく忘れるのでメモ。
UITextFieldと同じく、フォーカスが外れたときにキーボードは自動でかくしてくれる。
しかし「入力完了」の判定は「改行」ボタンを「完了」にするか、
他に「入力完了」ボタンなどを設置してそこに処理を書く必要があるみたい。

//キーボードを隠すとき
[_TextView resignFirstResponder];

//なお、逆に出したいとき
[_TextView becomeFirstResponder];

8
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
7