昨天,今天,明天,每天的每天,你是否都多懂得一点点...

星期五, 一月 30, 2015

IOS Transform logo back to its original position

It seems that the second transform calculate the position still based on the original position.


- (void) animateLogo{

    

    //Move the logo to center

    

    CGAffineTransform transformTranslate = CGAffineTransformMakeTranslation(0, 53.0);

    CGAffineTransform transformScale = CGAffineTransformMakeScale(1.35, 1.35);

    CGAffineTransform transformClock = CGAffineTransformConcat(transformScale, transformTranslate);

    [self.logoImageView setTransform:transformClock];

    

    

    [UIView animateWithDuration:1.0

     

                          delay: 0.0

     

                        options: UIViewAnimationOptionCurveEaseIn

     

                     animations:^{

                         //Move logo back to the original position.

                         CGAffineTransform transformTranslate2 = CGAffineTransformMakeTranslation(0, 0);

                         CGAffineTransform transformScale2 = CGAffineTransformMakeScale(1, 1);

                         CGAffineTransform transformClock2 = CGAffineTransformConcat(transformScale2, transformTranslate2);

                         [self.logoImageView setTransform:transformClock2];

                         

                     }

     

                     completion: ^(BOOL finish){

                         

                     }];

}


--
Feng

其它博客地址

此博客的同步博客地址: http://fengnz.wordpress.com
这里进入我的MSN SPACE.