我有一个视图,在那个视图里面我有一个 UIImageview 但在这个 UIImageview 里面我还有 3 个 UIImageview,这 3 个 UIImageview 我可以拖动它们并调整它们的大小,问题是当我调整其中一个的大小时它们都返回到原来的位置,为什么会这样?
更新:我用它来拖动图像
- (IBAction)handlePan:(UIPanGestureRecognizer *)recognizer {
CGPoint translation = [recognizer translationInView:_photo];
recognizer.view.center = CGPointMake(recognizer.view.center.x + translation.x,
recognizer.view.center.y + translation.y);
[recognizer setTranslation:CGPointMake(0, 0) inView:_photo];}
这用于调整大小,使用滑块
- (IBAction)sizePhoto:(UISlider *)sender {
switch (cambiaSize) {
case 1:
[_imagen1 setTransform:CGAffineTransformMakeScale(sender.value, sender.value)];
break;
case 2:
[_imagen2 setTransform:CGAffineTransformMakeScale(sender.value, sender.value)];
break;
case 3:
[_imagen3 setTransform:CGAffineTransformMakeScale(sender.value, sender.value)];
break;}}
我也用它来调整大小
_imagen1.transform = CGAffineTransformScale(self.view.transform,sender.value, sender.value);
我也使用这个水平翻转图像
_imagen2.transform = CGAffineTransformScale(_imagen2.transform,1.0, 1.0);
我想在执行任何这些操作时保持转换......