0
我有一个UITableView行。我希望所选单元始终位于UITableView的最顶端位置,并且选定单元格之后的单元格应该动画到底部。TableView动画
对于动画到顶部我用这个代码:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
{
CGFloat height = 44.0f; //cell height
tableView.contentInset = UIEdgeInsetsMake(0, 0, height * indexPath.row, 0);
[tableView setContentOffset:CGPointMake(0, (indexPath.row * height))
animated:YES]; //set the selected cell to top
}
我的问题是我怎么能在选定单元底部后,动画细胞?
我想要将所选索引上方的行顶部和底部的选定索引下面的行设为底部, – swetha 2014-09-11 11:40:17
原理相同。你可以调整上面的代码来做到这一点。 – freshking 2014-09-11 11:47:36