In iOS selected cell should move to top portion in UITableView

后端 未结 4 527
后悔当初
后悔当初 2020-12-20 07:05

I have more than 20 cells in my custom table view, in execution time 6 cells will be visible. Now i select the 4 th cell means, that 4th cell have to come in first position

4条回答
  •  梦毁少年i
    2020-12-20 07:53

    Use below method to scroll your tableview.

    [tableview setContentOffset:CGPointMake(0, button.tag*tableview.rowHeight) animated:YES];
    

    This method will make tableview scroll to specified point. Change value of Y in CGPointMake according to your code.

提交回复
热议问题