有一種方法可以自定義通過performBatchUpdates完成的動畫定時嗎?UICollectionViewCell performBatchUpdates動畫時間
我有這樣的代碼
[self.stepCollectionView performBatchUpdates:^{
self.stepSelectedIndex = indexPath.row;
UICollectionViewCell *cell = [self.stepCollectionView cellForItemAtIndexPath:indexPath];
[UIView transitionWithView:cell
duration:0.5f
options: UIViewAnimationOptionLayoutSubviews | UIViewAnimationOptionBeginFromCurrentState
animations:^{
CGRect frame = cell.frame;
frame.size.height = 416;
cell.frame = frame;
}
completion:^(BOOL finished) {
}];
} completion:^(BOOL finished) {
}];
我會改變UICollectionViewCell的高度,並在同一時間重組UICollectionViewCell的子視圖。
見http://stackoverflow.com/questions/12922780/how-do-you-set-the-找到示例的完整源代碼duration-for-uicollectionview-animations –