2014-10-27 47 views
-1

我们可以开始一个部分(UITableView)的部分号码?我们可以开始一个部分(UITableView)的部分号码?

例如我想开始第3节?

+1

你所说的“开始”的意思吗?你的意思是“以第3节位于视图顶部的方式放置桌子”? – dasblinkenlight 2014-10-27 20:24:29

+0

你是什么意思开始?如果你想滚动到第3部分或者表格视图不能要求小于3的部分? – 2014-10-27 20:25:00

+0

是的,谢谢! – 2014-10-27 20:44:37

回答

0

如果你想在表中的行定位在这样一个特定的部分是在视图的顶部,这样做:

UITableView *tableView; // <<== This is your table view 
... 
NSInteger desiredSection = 3; 
NSIndexPath *scrollTo = [NSIndexPath indexPathForRow:0 inSection:desiredSection]; 
[tableView scrollToRowAtIndexPath:scrollTo 
       atScrollPosition:UITableViewScrollPositionTop 
        animated:YES]; // <<== Use NO if you do not want animation 
+0

非常感谢,这正是我想要的! – 2014-10-27 20:44:09

相关问题