UITableView move to cell

前端 未结 3 1264
小鲜肉
小鲜肉 2020-12-09 01:02

I want to make next:

I have an UITableView that have to dispaly words (A-Z).

Currently when view did load I have one cell that displayed (and this is correct

3条回答
  •  生来不讨喜
    2020-12-09 01:32

    You are right to identify the scrollToRowAtIndexPath method. So all you need to do is create a fresh IndexPath with the row you wish to move to, e.g., row index = 10:

    [tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:10 inSection:indexPath.section] 
                 atScrollPosition:UITableViewScrollPositionMiddle animated:NO];
    

提交回复
热议问题