Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS: Disable UITableView animation when keyboard shows up

Everyone wants to move the UITableView when the keyboard pops up, but I'm looking for a way to disable the automatic animation to the cursor when the keyboard pops up. I'm experiencing an odd jerking / jolting / erratic scrolling behavior when the keyboard pops up and causes the UITableView to scroll to the cursor (to avoid blocking it).

Each of my UITableView cells has a UITextView in it. I don't commit any other animations when the keyboard pops up.

At this point, I would like to disable the animation completely and manually scroll to a desired CGPoint.

Thank you!

like image 767
powertoold Avatar asked Apr 06 '12 07:04

powertoold


1 Answers

The automatic scrolling code resides in tableViewController, so auto-scrolling can't be disabled. Instead of subclassing from UITableViewController you can subclass from UIViewController and use a tableView inside it. If you are willing to use UITableViewController itself, you can override viewWillAppear and don't call [super viewWillAppear].

like image 112
Abhay Singh Avatar answered Nov 08 '22 09:11

Abhay Singh