开发者

Objective C - moving an image

开发者 https://www.devze.com 2023-03-18 08:02 出处:网络
Im trying to move a UIImage from the top of the screen to the top. I know how to do Animations, but if i did it that way, there would be a few hundred images. I know that i can use something called CG

Im trying to move a UIImage from the top of the screen to the top. I know how to do Animations, but if i did it that way, there would be a few hundred images. I know that i can use something called CGPoint? Can someone give me a example of how to move a imag开发者_Go百科e with a CGPoint?

Thanks very much appreciated.


Do something like this:

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:3.0];
[myImageView setFrame:CGRectMake(0, 0, 50, 50];
[UIView commitAnimations];

That will make the imageView goto the top from whatever position it is currently in.

0

精彩评论

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