keep on you
keep on you

Reputation: 310

Keyboard covers up my UIViewController?

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? UIViewController

UITableViewController

Upvotes: 4

Views: 2945

Answers (2)

tams
tams

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

PengOne
PengOne

Reputation: 48398

There are a few good options for the first case:

  1. Raise the UITextView programmatically when the keyboard is up and the UITextView is first responder following this excellent solution or this equally excellent solution.

  2. 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

Related Questions