关于ios:使用animateWithDuration翻转视图本身

Flip view itself using animateWithDuration

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

无效

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

淡出视图

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

我的问题是,options参数何时生效?

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

1
2
3
[UIView transitionFromView: self.lblEvent toView:self.lblEvent
duration:2.0 options:UIViewAnimationOPtionTransitionFlipFromLeft
completion:nil];


试试这个:

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

    }];

祝你好运!