我想知道是否有一种方法可以让 UIImage 根据程序中给出的多个坐标移动,例如:一个坐标将从左到右移动 10 个像素 第二个坐标将从上一个坐标继续,从上到下移动 20 个像素,依此类推
最佳答案
您可以进行如下操作
- (IBAction) doMoveLeft : (UIImageView *) sender
{
yourImageView=sender; //Make yourImageView globally accessible.
[yourImageView setFrame:(X,Y,Width,Height)];
}
/*
> Increase or Decrease your X,Y as per the requirement. Make (X,Y) of int type.
And Put them at global to access it where you need!
> At the time of showing images on your view, you can also give them dynamic
tags to distinguish them for further use.
*/
关于iphone - 如何根据给定的坐标移动 UIImage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9695576/