क्या [table beginUpdates]
/[table endUpdates]
एनिमेशन की अवधि बदलने का कोई तरीका है?UITableView एनीमेशन की अवधि बदलें (तालिका प्रारंभ के साथ पंक्तियां डालें/हटाएं)
विकल्प 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) {
}];
विकल्प 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];
इस सवाल का चेक आउट: http://stackoverflow.com/questions/3832474/uitableview-row-animation-duration-and-completion-callback/13041475#13041475 यह CATransaction का उपयोग करता है को प्राप्त करने के आप क्या चाहते हैं: -) –
मैंने यह प्रश्न देखा है। यह काम करेगा, लेकिन मेरी समस्या यह है कि मुझे विशेष रूप से अवधि की आवश्यकता है, जो काम नहीं करता है। आईई, इस प्रश्न में विकल्प 2 में, मुझे लाइन '[CATransaction setAnimationDuration: 5.0];' काम करने की आवश्यकता है और यह नहीं है। –
@TomRedman कभी भी इस समस्या के लिए एक अच्छा समाधान मिलता है? मैं उपरोक्त बेन से जुड़े प्रश्न में देखता हूं कि अब ऐसा लगता है जो आईओएस 7 में काम करता है, लेकिन 6 नहीं ... –