您的位置:首页 > 产品设计 > UI/UE

tableview跳转指定cell的某组某行的蛋疼问题

2016-02-03 22:13 477 查看
    今天遇到一个比较头疼滚绕我几天但也简单的问题,我在跳转指定cell的某组某行时,比如我想跳转到最后一个组的第一行时,第一次执行这个方法不能跳转到我想要的位置。代码走上

  这是没有修改之前的方法            图片本来我要跳转到乐天6的表头的

            [self.tableView
selectRowAtIndexPath:[NSIndexPath
indexPathForRow:0
inSection:position]
                                        animated:YES
                                  scrollPosition:UITableViewScrollPositionTop];

这是修改之后的方法  这个就可以跳转乐天6的表头

NSIndexSet *indexSet = [NSIndexSet indexSetWithIndex:position];
        [_tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationFade];
            [self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:position]
                                        animated:YES
                                  scrollPosition:UITableViewScrollPositionTop];
   修改之后就能跳转到指定的位置了   我也不知道为什么,但还是解决了这个问题,有知道的大神  希望能指点一下 - -
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ios UITableView