Czy istnieje sposób na zmianę czasu trwania animacji [table beginUpdates]
/[table endUpdates]
?Zmień czas trwania animacji UITableView (Wstaw/Usuń wiersze z tabelą beginUpdates)
To co próbowałem, bez powodzenia:
Wariant 1:
[UIView animateWithDuration:5.0 delay:0.0 options:(UIViewAnimationOptionCurveEaseInOut|UIViewAnimationOptionOverrideInheritedDuration) animations:^{
[self.tableView beginUpdates];
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithArray:indexPaths] withRowAnimation:UITableViewRowAnimationTop];
[self.tableView endUpdates];
} completion:^(BOOL finished) {
}];
Opcja 2:
[CATransaction begin];
[CATransaction setCompletionBlock:^{
NSLog(@"I actually get called!");
}];
[CATransaction setAnimationDuration:5.0]; //but I don't work
[self.tableView beginUpdates];
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithArray:indexPaths] withRowAnimation:UITableViewRowAnimationTop];
[self.tableView endUpdates];
[CATransaction commit];
Sprawdź to pytanie: http://stackoverflow.com/questions/3832474/uitableview-row-animation-duration-and-completion-callback/13041475#13041475 Wykorzystuje CATransaction aby osiągnąć to, co chcesz: -) –
Widziałem to pytanie. To by działało, ale moim problemem jest to, że potrzebuję konkretnie czasu, który nie działa. 01.etj. W opcji 2 w tym pytaniu potrzebuję linii '[CATransaction setAnimationDuration: 5.0];' do pracy, a nie działa. –
@TomRedman kiedykolwiek dostaniesz dobre rozwiązanie dla tego problemu? Widzę w pytaniu powiązanym z Benem, że teraz wydaje się, że działa on w systemie iOS 7, ale nie 6 ... –