-2

Currently, I have a textfield at the bottom of my screen. I am wondering how do I move the entire view up when the keyboard appears? Right now it is covering the textfield. Thanks!

Matthias Bauch
  • 88,097
  • 19
  • 217
  • 244
user3208182
  • 1
  • 1
  • 1
  • Have you googled, searched and read the previously asked questions? Also show your code and provide further details to get better help. – Neeku Jan 17 '14 at 20:46
  • possible duplicate of [Xcode/iOS5: Move UIView up, when keyboard appears](http://stackoverflow.com/questions/7952762/xcode-ios5-move-uiview-up-when-keyboard-appears), or [Move UIView up when the keyboard appears in iOS](http://stackoverflow.com/questions/11282449/move-uiview-up-when-the-keyboard-appears-in-ios), or [UITextField: move view when keyboard appears](http://stackoverflow.com/questions/1775860/uitextfield-move-view-when-keyboard-appears) – Matthias Bauch Jan 17 '14 at 21:04
  • Yes I had. I am looking for a way such that when the textfield is clicked (or edit), it will move the view up showing both the textfield and the keyboard. I have searched for NSNotificationCenter but I don't find it straight forward. Any idea? – user3208182 Jan 17 '14 at 21:04
  • Study the code in this SO answer: http://stackoverflow.com/a/11282535/2410991 – hgwhittle Jan 17 '14 at 21:13
  • What was wrong with all of the related questions that SO shows you as you enter your question? – rmaddy Jan 17 '14 at 22:17

1 Answers1

0

You can respond to the keyboard appearing/disappearing by observering the UIKeyboardWillShowNotification / UIKeyboardWillHideNotification notifications (see NSNotificationCenter).

Taum
  • 2,463
  • 16
  • 17