UIImageView scale from center using Animation Blocks

前端 未结 3 1396
被撕碎了的回忆
被撕碎了的回忆 2021-02-08 01:31

I am using the following to scale image up but it\'s scaling from it\'s left top point, how can I make the scale from center

[UIView animateWithDuration:duration         


        
3条回答
  •  礼貌的吻别
    2021-02-08 01:51

    [UIView animateWithDuration:0.5 
                          delay:0
                        options:UIViewAnimationOptionBeginFromCurrentState
                     animations:(void (^)(void)) ^{
                         myImageView.transform=CGAffineTransformMakeScale(1.2, 1.2);
                     }
                     completion:^(BOOL finished){
                         myImageView.transform=CGAffineTransformIdentity;
                     }];
    

    this will work perfectly
    Good Luck

提交回复
热议问题