2013-11-26 28 views
1

我正在使用UIView animateWithDuration方法翻转UILabelView本身,但它不显示任何动画,直到我在动画块中提供了一些代码。这是代码。使用animateWithDuration翻转视图本身

没有影响

[UIView animateWithDurations:5. delay:0. 
options:UIViewAnimationOPtionTransitionFlipFromLeft animations: ^{} 
completion:nil]; 

衰查看

[UIView animateWithDurations:5. delay:0. 
options:UIViewAnimationOPtionTransitionFlipFromLeft 
animations: ^{self.lblEvent.alpha = 0.5;} completion:nil]; 

我的问题是,当选择参数会有效果呢?

我也尝试了下面的代码,但它翻转视图并从控制器中删除。我不能提供相同的观点吗?

[UIView transitionFromView: self.lblEvent toView:self.lblEvent 
duration:2.0 options:UIViewAnimationOPtionTransitionFlipFromLeft 
completion:nil]; 
+0

这可能会帮助你http://stackoverflow.com/questions/9524048/how-to-flip-an-individual-uiview-without-flipping-the-parent-view?rq=1 – suhit

+0

不,在上面链接翻转并不是针对整个控制器,而是仅针对控制器的子视图。 –

+0

你只想翻转uilabel吗? – suhit

回答

2

试试这个:

[UIView transitionWithView:your_view_to_animate duration:1. options:(UIViewAnimationOptionTransitionFlipFromBottom) animations:^{ 
    } completion:^(BOOL finished) { 

    }]; 

祝您好运!

+0

太棒了。有用。但还有一个问题,animateWithDuration中的选项是什么? –

+0

我不太确定那些:) –

+1

animateWithDuration这个方法会根据输入的动画时间减慢它/ – Vinodh