ios 图片放大缩小动画效果

    //animateWithDuration 后面是多少秒
    UIView *singleMapView = [[UIView alloc]
                             initWithFrame:CGRectMake(10, 150, 300, 250)];
    singleMapView.backgroundColor = [UIColor blackColor];
    [self.view addSubview:singleMapView];
    singleMapView.transform = CGAffineTransformMakeScale(0.05, 0.05);
    [UIView animateWithDuration:0.5
                     animations:^{
                         singleMapView.transform = CGAffineTransformMakeScale(1.2, 1.2);
                     }completion:^(BOOL finish){
                        
                                                                                   }];


CGAffineTransformMakeScale 缩放函数,括号内为比例。+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations completion:(void (^)(BOOLfinished))completion  view由一个大小缩放到另外一个大小的动画效果。

你可能感兴趣的:(ios 图片放大缩小动画效果)