UICollectionView单元格动画的特效
2017-07-18 本文已影响0人
iOS乐乐
- (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath {
SXTNearLiveCell * c = (SXTNearLiveCell *)cell;
[c showAnimation];
}
//Cell
@implementation SXTNearLiveCell
- (void)showAnimation {
//x和y的最终值为1
if (self.live.isShow) {
return;
}
self.layer.transform = CATransform3DMakeScale(0.1, 0.1, 1);
[UIView animateWithDuration:1 animations:^{
self.layer.transform = CATransform3DMakeScale(1, 1, 1);
self.live.show = YES;
}];
}