/*_selectedInt 是需要选中的Cell 位置*/
NSInteger selectedIndex = _selectedInt;
NSIndexPath *selectedIndexPath = [NSIndexPath indexPathForRow:selectedIndex inSection:0];
[_testTableView selectRowAtIndexPath:selectedIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone];//选中指定cell选中状态
[_testTableView scrollToRowAtIndexPath:selectedIndexPath atScrollPosition:UITableViewScrollPositionTop animated:YES];//cell滚动到选中指定cell位置
![](https://img.haomeiwen.com/i10324476/79ecc5abdb70f222.gif)
网友评论