//在- (void)viewDidLoad方法中加入 //加载后自动定位到某一行 NSIndexPath *idxPath = [NSIndexPath indexPathForRow:8 inSection:0];//定位到第8行 [self.resultCommunityTableview scrollToRowAtIndexPath:idxPath atScrollPosition:UITableViewScrollPositionMiddle animated:NO];
转载于:https://www.cnblogs.com/qingjoin/archive/2012/08/24/2654340.html
本文介绍如何在iOS应用中使用UITableView时,通过代码实现自动滚动到指定行的功能。具体方法是在viewDidLoad方法中设置NSIndexPath并调用scrollToRowAtIndexPath方法,实现UITableView加载后自动定位到某一行。

6831

被折叠的 条评论
为什么被折叠?



