ios4 – iOS 4.2:使用块动画翻转图像

ios4 – iOS 4.2:使用块动画翻转图像,第1张

概述我有这个代码我的应用程序: [UIView beginAnimations:nil context:NULL];[UIView setAnimationDuration:1];[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:imgView cache:YES]; imgView.i 我有这个代码我的应用程序:
[UIVIEw beginAnimations:nil context:NulL];[UIVIEw setAnimationDuration:1];[UIVIEw setAnimationTransition:uiviewanimationtransitionFlipFromleft forVIEw:imgVIEw cache:YES];    imgVIEw.image = img2;[UIVIEw commitAnimations];

但是在iOS 4.0及更高版本中不鼓励使用此方法,我应该使用TransitionWithVIEw:duration:options:animations:completion:

我不能让它正常工作.有人可以帮我吗
谢谢!

解决方法
[UIVIEw TransitionWithVIEw:imgVIEw    // use the forVIEw: argument                  duration:1          // use the setAnimationDuration: argument                   options:UIVIEwAnimationoptionTransitionFlipFromleft                           // check UIVIEwAnimationoptions for what options you can use                animations:^{         // put the animation block here                              imgVIEw.image = img2;                           }                completion:NulL];     // nothing to do after animation ends.
总结

以上是内存溢出为你收集整理的ios4 – iOS 4.2:使用块动画翻转图像全部内容,希望文章能够帮你解决ios4 – iOS 4.2:使用块动画翻转图像所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1112729.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存