2012-12-10 29 views
1

我有这个简单的代码:如何在动画之后执行代码?

-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    BGEditTextField * theTableViewCell = (BGEditTextField *) [self.tableView cellForRowAtIndexPath:indexPath]; 
    theTableViewCell.displaytextField =true; 
    [self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:YES]; 
    //self.helpFinishUpdating.viewNotToCover = theTableViewCell; 
} 

一切都只是完美的,我想

self.helpFinishUpdating.viewNotToCover = theTableViewCell


[self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:YES];完成后执行。

我该怎么做到这一点?

我之所以这样做的原因是因为self.helpFinishUpdating.viewNotToCover = theTableViewCell;UITableViewCell的帧位置很敏感。我希望UITableViewCell在执行之前先到达最终位置。

回答

1

UITableViewDelegate符合UIScrollViewDelegate,所以您可以只实施scrollViewDidEndDecelerating:或任何适合您的需求。

+0

不够好。但是,那么如果用户启动滚动呢?我可以解决问题,但不是那么简单。 –

+0

没有更好的答案。 –

+1

我认为这是恭维:D – jimpic

相关问题