gpt4 book ai didi

ios4 - iOS 4.2 : Flip image using block animations

转载 作者:行者123 更新时间:2023-12-03 23:27:20 26 4
gpt4 key购买 nike

我的应用程序中有这段代码:

[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 : Flip image using block animations,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3737878/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com