zoom entire UICollectionView

前端 未结 3 1320
面向向阳花
面向向阳花 2020-12-08 08:36

I have an iPad App where I\'m using a UICollectionView and each UICollectionViewCell contains just a single UIImage. Currently I\'m displaying per 9 UIImages (3 rows * 3 col

3条回答
  •  轮回少年
    2020-12-08 09:33

    Sorry for my 2 cents question, I have found the solution, very simple.

    In my PinchGesture callback I have just done the following:

    void (^animateChangeWidth)() = ^() {
        _theFlowLayout.itemSize = cellSize;
    };
    
    [UIView transitionWithView:self.theCollectionView 
                      duration:0.1f 
                       options:UIViewAnimationOptionCurveLinear 
                    animations:animateChangeWidth 
                    completion:nil];
    

    All cells of my UICollectionView are successfully changed and with a nice transition.

提交回复
热议问题