我用insertRowsAtIndexPath代替了reloadData。 在第一次加載時,動畫太快,因爲行數很高。控制uitableview的插入速度insertRowsAtIndexPath動畫
我可以控制insertRowsAtIndexPath的速度動畫嗎?
謝謝。
我用insertRowsAtIndexPath代替了reloadData。 在第一次加載時,動畫太快,因爲行數很高。控制uitableview的插入速度insertRowsAtIndexPath動畫
我可以控制insertRowsAtIndexPath的速度動畫嗎?
謝謝。
我認爲不可能操縱動畫速度。
也許你可以用scrollToRowAtIndesPath
代替。
絕對未經檢驗的,但你可以嘗試一下本作的五秒鐘的動畫:
[UIView animateWithDuration:5. animations:^(void){
[_tableView insertRowsAtIndexPath:... animated:NO];
}];
覆蓋的insertRowsAtIndexPaths並添加自定義動畫作爲您與延遲喜歡。
- (void)insertRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation: (UITableViewRowAnimation)animation
{
for (NSIndexPath *indexPath in indexPaths)
{
UITableViewCell *cell = [self cellForRowAtIndexPath:indexPath];
[cell setFrame:CGRectMake(320, cell.frame.origin.y, cell.frame.size.width, cell.frame.size.height)];
[UIView beginAnimations:NULL context:nil];
[UIView setAnimationDuration:1];
[cell setFrame:CGRectMake(0, cell.frame.origin.y, cell.frame.size.width, cell.frame.size.height)];
[UIView commitAnimations];
}
}