UITableView中selectRowAtIndexPath: animated:scrollPosition滚动到指定Row

- (void)viewDidLoad{

//调用下面封装的方法

[self performSelectorOnMainThread:@selector(didSelectToProperCell) withObject:nil waitUntilDone:NO];

}

//写一个方法

- (void)didSelectToProperCell{
    
    [self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:self.index inSection:0] animated:YES scrollPosition:(UITableViewScrollPositionTop)];
    
}

 

本文章属于原文、请勿转载!

posted @ 2016-11-08 14:49  落花伊人  阅读(366)  评论(0编辑  收藏  举报