2013-03-18 68 views
0

在我的应用程序中,我想给一个图像的翻转动画,当一个按钮被点击时。但是当我尝试这样做时,我只能对CGAffinetransformationMake做一个图像的四种转换(移动,缩放,旋转,翻译)。但我需要翻转式的转换。任何人都可以帮助我做到这一点?Custom CGAffineTransformationMake

+0

您可以使用UIViewAnimationOptionTransitionFlipFromLeft或UIViewAnimationOptionTransitionFlipFromRight动画。 – Mrunal 2013-03-18 11:52:09

+0

@mrunal我认为这个选项适用于segue transition.not对于图像 – haritha 2013-03-18 11:54:56

+0

nope这是UIView动画,你的UIImageView已经被UIView继承,所以你可以使用它来进行图像视图。 – Mrunal 2013-03-18 11:56:09

回答

0

试试这个。它一定会有所帮助。在按钮点击功能中,您必须编写此代码。

[UIView beginAnimations: nil context: nil]; 
[UIView setAnimationDuration: 0.5f]; 
[UIView setAnimationTransition: UIViewAnimationTransitionFlipFromLeft forView:yourImageName cache: YES]; 
[UIView commitAnimations]; 
0

尝试下面的一个希望它会帮助你一点点。

[UIView animateWithDuration:0.5 animations:^(void){ 
    _viewSlidecontainer.transform = CGAffineTransformMakeScale(1.0, 0.0); 
} completion:^(BOOL finished){ 
    [UIView animateWithDuration:0.5 animations:^(void){ 
     _viewSlidecontainer.transform = CGAffineTransformMakeScale(1.0, 1.0); 
    } completion:^(BOOL finished){ 

    }]; 
}];