开发者

iPad: Image Animation , Image Flickering problem

开发者 https://www.devze.com 2023-01-21 01:43 出处:网络
I am making an iPad application. In that for moving image from left to right and vice-a-versa. I am using following code for makingthe animation

I am making an iPad application. In that for moving image from left to right and vice-a-versa. I am using following code for making the animation

animation = [CATransition开发者_开发百科 animation];

[animation setDelegate:self];
[animation setDuration:AnimationDuration];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromRight];

[[ImgMainPhoto layer] addAnimation:animation forKey:@"animate"]; 

but in this animation when I move the image on the touchmoved function , the image will be moved, but shows some Flickering.

Can any one suggest me what changes I need to put in my code.

thanks in advance.


You don't need to use a transition for what it sounds like you're trying to do. You can instead just animate the view's center or the layer's position. Take a look at the answer I gave here. In your case, you may not want to repeat the animation, but you can just remove that line. If you need clarification, just update your answer above and then let me know by posting a comment to my answer here.

Best regards.


I have got the answer, I was calling the animation for the two times and there for it was flickering.

0

精彩评论

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

关注公众号