tableView显示页面的时候默认选择某行

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:YES];
    NSIndexPath *indexpath = [NSIndexPath indexPathForRow:9 inSection:0];
    
    [self.tableView scrollToRowAtIndexPath:indexpath atScrollPosition:UITableViewScrollPositionTop animated:YES]; 
    
    [self.tableView selectRowAtIndexPath:indexpath animated:YES scrollPosition:UITableViewScrollPositionMiddle]; 
}

© 2017. All rights reserved.

Powered by Hydejack v7.5.0