我正在使用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
}
但是图像并没有改变原点或尺寸......我做错了什么?