-[UITableView scrollToRowAtIndexPath:] scrolls, but goes back to 1st row

前端 未结 2 1584
庸人自扰
庸人自扰 2020-12-18 10:10

I have a grouped table view with textfields in the tableview. For the keyboard to not hide the textfields, in the textFieldShouldBeginEditing, I am calling the scrollToRowAt

2条回答
  •  南笙
    南笙 (楼主)
    2020-12-18 10:56

    //For iOS 7 
            [self.TableView reloadData];
            NSIndexPath *indexPat = [NSIndexPath indexPathForRow:1 inSection:1];
            [self.TableView scrollToRowAtIndexPath:indexPat atScrollPosition:UITableViewScrollPositionTop animated:YES];
    

提交回复
热议问题