|
|
|
|
|
by thought_alarm
5200 days ago
|
|
You should be setting the TableView's `contentInset` and `scrollIndicatorInsets` properties, rather than adjusting the TableView's frame. Convert the keyboard frame to the superview's coordinate system using `-convertRect:fromView:`, e.g. : keyboardFrame = [tableView.superview convertRect:keyboardFrame
fromView:tableView.window];
The bottom inset is then simply the difference between the TableView's height and the keyboard's Y coordinate.You would also set those properties and scroll to the selected row in the same animation block. |
|
Would that method have any significant advantages? Less code? Would it avoid all the crazy frame calculations depending on the rotation?