2016-11-12 21 views

答えて

0

は、以下のあなたがUIImageView自体を使用して行うことができますズーム画像のための単純な実装

-(void)StartAnmation { 
      [subview.layer addAnimation:[self ZoomAnimation] forKey:@"Zoom"]; 
} 

-(CAAnimationGroup *)ZoomAnimation { 
    CAAnimationGroup *ZoomAnimation = [CAAnimationGroup animation]; 
    CABasicAnimation *In = [self zoomIn]; 
    ZoomAnimation.animations = [NSArray arrayWithObjects: In, nil]; 
    ZoomAnimation.duration = 2.0f; 
    return ZoomAnimation; 
} 

    -(CABasicAnimation *)zoomIn { 
CABasicAnimation *ZoomInAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"]; 
     ZoomInAnimation.beginTime = 0.0f; 
     ZoomInAnimation.fromValue = [NSNumber numberWithFloat:20.0]; 
     ZoomInAnimation.toValue = [NSNumber numberWithFloat:1.0]; 
     ZoomInAnimation.duration = 2.0f; 
     return ZoomInAnimation; 
    } 
関連する問題