Reputation: 310
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?
Upvotes: 4
Views: 2945
Reputation: 830
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!
Upvotes: 2
Reputation: 48398
There are a few good options for the first case:
Raise the UITextView
programmatically when the keyboard is up and the UITextView
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.
Upvotes: 0