iOS: Disable UITableView animation when keyboard s

2019-02-05 03:11发布

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!

1条回答
疯言疯语
2楼-- · 2019-02-05 03:15

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

查看更多
登录 后发表回答