开发者

Simplest means to fade/dissolve between two UIImageViews

开发者 https://www.devze.com 2022-12-22 00:42 出处:网络
Could someone give me a little direction on creating crossfades/dissolves between two UIImageViews in the same view controller? I am trying to set up an eff开发者_如何学编程ect of a background image s

Could someone give me a little direction on creating crossfades/dissolves between two UIImageViews in the same view controller? I am trying to set up an eff开发者_如何学编程ect of a background image slideshow but not sure on the mechanics. Thanks.


The simplest method is to do two alpha fades:

//set up two image views, view1 and view2
view1.alpha = 1.0;
view2.alpha = 0.0;
[myView addSubview: view1];
[myView addSubview: view2];
[UIView beginAnimation: nil context: nil];
view1.alpha = 0.0;
view2.alpha = 1.0;
[UIView commitAnimations];
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号