翻转动画忽略了持续时间,即我无法控制速度

|| 因此,我尝试在两个图像之间切换,但是持续时间似乎被忽略了。 我了解到Apple必须非常迅速地进行一些动画处理才能使魔术保持活力,但是有没有办法减慢翻转的速度? 我当前的对象层次是游戏板,其中包含许多从UIView继承的卡。 卡片的正面和背面是承载UIImage和其他数据的UIView
[UIView animateWithDuration:15.0 
    animations:^(void) {
        cardOne.center =CGPointMake(100, 100);
        cardTwo.center =CGPointMake(100, 100);

        //low level calls, to directly perform the image swap 
        [cardOne.face removeFromSuperview]; 
        [cardOne addSubview:cardOne.back];
        [cardOne sendSubviewToBack:cardOne.face]; 

        //calling the transitionFromView to do the image swap
        [UIView transitionFromView:cardOne.face 
                            toView:cardOne.back 
                          duration:10 
                           options:UIViewAnimationTransitionFlipFromLeft 
                        completion:^(BOOL finished){ }];
感谢您的反馈意见。我尝试将您输入的所有内容混合在一起,但最终确实可以正常工作。我还不知道为什么。 感谢您的回复。我尝试恢复到旧样式,但效果很好。我还没有弄清楚为什么。 非工作代码被注释掉,而工作代码则未注释。 再次感谢
/*  
[UIView animateWithDuration:animationDuration  
animations:^{  
    [self.face removeFromSuperview];    
    [self addSubview:self.back];  
    [self sendSubviewToBack:self.face];              
}];  
*/

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:kDefaultFlipSpeed];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft
                               forView:self
                                 cache:YES];

[self.face removeFromSuperview];
[self addSubview:self.back];
[self sendSubviewToBack: self.face];

[UIView commitAnimations];
    
已邀请:
我不能在评论中提问,所以: 您是否尝试了不到10秒的时间?更精确地说是在0-1秒之间。大约是0.5秒。告诉我您是否注意到这些值的持续时间有任何变化。 我的快速答案是: 尝试将10秒设置为
10.0
10.0f
。 希望能帮助到你。     

要回复问题请先登录注册