Objective c 如何在动画之后执行代码?
我有一个简单的代码:Objective c 如何在动画之后执行代码?,objective-c,xcode4.5,Objective C,Xcode4.5,我有一个简单的代码: -(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { BGEditTextField * theTableViewCell = (BGEditTextField *) [self.tableView cellForRowAtIndexPath:indexPath]; theTableViewCell.displaytextFi
-(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.helpfinishUpdate.viewNotToCover=表格视图单元格
在[self.tableView scrollToRowatinexpath:indexath atScrollPosition:UITableViewScrollPositionTop动画:是]代码>已完成
我将如何实现这一点
我之所以要这样做,是因为self.helpfinishupdate.viewNotToCover=TableViewCell代码>对UITableViewCell
的帧位置敏感。我希望在执行之前,UITableViewCell
首先到达最终位置。UITableViewDelegate
符合UIScrollViewDelegate
,因此,您可以只实现ScrollViewDiEndDecelling:
或任何适合您需要的工具。UITableViewDelegate
符合UIScrollViewDelegate
,因此您可以只实现ScrollViewDiEndDecelling:
或任何适合您需要的工具。足够好了。但是,如果用户启动滚动呢?我能解决问题,但没那么简单。我把这当作是一种恭维:够好了。但是,如果用户启动滚动呢?我能解决问题,但没那么简单。我认为这是一种恭维:D