【发布时间】:2015-01-18 10:41:59
【问题描述】:
我在动画中有这段代码:
image.frame = CGRectMake(x: x, y: y, width, height)
我需要获取图像的 x 和 y 坐标。我找到了这个 Objective-C 代码:
CGPoint origin = imageView.frame.origin;
找到图像的 x 和 y 位置后,我需要对其进行转换。我会使用类似的东西:
image.frame = CGRectMake(x-50, y-50, width+500, height+500)
...这样我就可以在屏幕上移动图像。如何找到原始的 x 和 y 位置?
【问题讨论】:
标签: ios swift cgrectmake