在一个tableView中,我在section0上有4行,在section1上有3行。如果我在indexPath(1,2)处点击该行,则会出现另一行,其中包含UIPickerView。我希望tableView滚动,以便pickerView在屏幕顶部移动。为此,我实施了
[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:2 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES];
但这只是向上滚动了一点,不多。
这里有什么我想念的吗?任何帮助将非常感激。提前谢谢。
答案 0 :(得分:0)
[self.tableView beginUpdates];
...
[self.tableView endUpdates];
如果有人遇到同样的问题,我会在这里留下答案。