scrollToRowAtIndexPath不会偏移到特定单元格

时间:2014-01-29 21:15:18

标签: uitableview

我有一个tableview,每个单元格都是屏幕大小。分页已启用。我正在使用以下代码在加载tableview时显示特定的单元格:

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self.myTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:picID] atScrollPosition:UITableViewScrollPositionMiddle animated:NO];

}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return [URLstringArrays count];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}

我从另一个控制器传递picID但是tableview没有在指定的部分启动。什么可能是错的?感谢

0 个答案:

没有答案