I have a UIViewController which has a UITextView and UIImageView, when the keyboard comes up it covers up my UITextView. so how can i do to manage that and the same for the UITableView?

- 310
- 6
- 21
-
1possible duplicate of [How to make a UITextField move up when keyboard is present](http://stackoverflow.com/questions/1126726/how-to-make-a-uitextfield-move-up-when-keyboard-is-present) – Kevin Dec 02 '14 at 02:33
2 Answers
You can put all of the items inside a ScrollView and then move the view to compensate for the keyboard. Someone has already written a really handy class, check out: https://github.com/michaeltyson/TPKeyboardAvoiding
Hope this helps!

- 830
- 5
- 9
-
...and it works very well. You can find in http://iosdevblog.com/2014/07/26/keyboard-hides-text-fields/ a tutorial about it – angelos.p Jul 26 '14 at 15:53
There are a few good options for the first case:
Raise the
UITextView
programmatically when the keyboard is up and theUITextView
is first responder following this excellent solution or this equally excellent solution.Add everything onto a
UIScrollView
so that it moves appropriately when the keyboard is raised following this simple tutorial
A UITableView
will manage this pretty well for you automatically using the – scrollToRowAtIndexPath:atScrollPosition:animated:
method, but either of the above solutions will also work.