-[UITableView scrollToRowAtIndexPath:] scrolls, but goes back to 1st row

前端 未结 2 1565
庸人自扰
庸人自扰 2020-12-18 10:10

I have a grouped table view with textfields in the tableview. For the keyboard to not hide the textfields, in the textFieldShouldBeginEditing, I am calling the scrollToRowAt

2条回答
  •  囚心锁ツ
    2020-12-18 10:49

    I suspect what is going on is that the table view is rubber banding back, just like a webview in Safari does when you run pass its bounds. The most likely reason for this is that when you pop up the keyboard it is on top of the table view, but the table view has not physically contracted, thus all the UITableViewCells fit within the partially obscured UITableView, and when some of them scroll off it rubber bands so they all are within it.

    In order to test this try reducing the size of the list view so that you can see the whole thing when the keyboard is displayed, if the bug goes away you want to write code that dynamically changes the size as the keyboard animates in and out.

提交回复
热议问题