这是所有帐户应该工作的代码,它是在UIVIEwControllerAnimatedTransitioning类中设置的,但我在之前的自定义segue类中有相同的问题;
[UIVIEw animateWithDuration:0.4f delay:0.0f options:UIVIEwAnimationoptionCurveEaseInOut animations:^(voID) { self.dimVIEw.Alpha = 1.0; self.imageVIEw.frame = self.destinationRect; } completion:^(BOol finished) { [self.imageVIEw removeFromSupervIEw]; [self.dimVIEw removeFromSupervIEw]; [TransitionContext completeTransition:YES]; }];
但是,使用以下代码的d簧动画虽然我不愿意这样做.
[UIVIEw animateWithDuration:0.8f delay:0 usingSpringWithdamPing:0.7f initialSpringVeLocity:2.0f options:UIVIEwAnimationoptionCurveEaseInOut animations:^(voID) { self.dimVIEw.Alpha = 1.0; self.imageVIEw.frame = self.destinationRect; } completion:^(BOol finished){ [self.imageVIEw removeFromSupervIEw]; [self.dimVIEw removeFromSupervIEw]; [TransitionContext completeTransition:YES]; }];
我在模拟器和iPad2测试设备上得到了相同的行为.
难道我做错了什么?
动画帧或Alpha值是否存在问题?
[UIVIEw beginAnimations:nil context:NulL];[UIVIEw setAnimationBeginsFromCurrentState:YES];[UIVIEw setAnimationDuration:0.4f];[UIVIEw setAnimationCurve:UIVIEwAnimationCurveEaseInOut];[UIVIEw setAnimationDelegate:self];[UIVIEw setAnimationDIDStopSelector:@selector(animationDIDStop)];self.dimVIEw.Alpha = 1.0;self.imageVIEw.frame = self.destinationRect;[UIVIEw commitAnimations];- (voID) animationDIDStop { [self.imageVIEw removeFromSupervIEw]; [self.dimVIEw removeFromSupervIEw]; [TransitionContext completeTransition:YES];}
希望能帮助到你.
总结以上是内存溢出为你收集整理的ios – UIView动画曲线不能正常工作全部内容,希望文章能够帮你解决ios – UIView动画曲线不能正常工作所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)