更改定位点后,如何调整图像位置? (迅速)

时间:2015-04-18 01:12:05

标签: ios swift uiimage pinch anchorpoint

我正在使用UIGestureRecognizer进行捏合操作,我需要更改定位点以调整大小到UIImage的正确位置。更改锚点后,图像会移动一点,我需要将其放回原点。这就是我在做的事情:

 override func viewWillAppear(animated: Bool) {
    super.viewWillAppear(animated)
    imageThinkCreatively.layer.anchorPoint = CGPointMake(0.6, 0.7)
    imageThinkCreatively.frame = CGRectMake(0, 0, 200.0, 200.0)
    imageThinkCreatively.layoutIfNeeded()
}
@IBAction func scaleImage(sender: UIPinchGestureRecognizer) {

    sender.view!.transform = CGAffineTransformScale(sender.view!.transform, sender.scale, sender.scale)
    sender.scale = 1

 }

但是图像并没有改变原点或尺寸......我做错了什么?

0 个答案:

没有答案