4

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

keep on you
  • 310
  • 6
  • 21
  • 1
    possible 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 Answers2

2

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!

tams
  • 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
0

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.

Community
  • 1
  • 1
PengOne
  • 48,188
  • 17
  • 130
  • 149