当前位置: 代码迷 >> 综合 >> iOS捏合手势(Pinch)
  详细解决方案

iOS捏合手势(Pinch)

热度:43   发布时间:2024-01-20 19:27:49.0

 UIPinchGestureRecognizer *pinch = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(imageViewPinch:)];


pinch.delegate = self;


//设置属性 点击此次 1单击 2双击

//手势View 对象 添加给UIImageView

[imgView addGestureRecognizer:pinch];

[self.view addSubview:imgView];



#pragma mark - 点击手势触发事件

-(void)imageViewPinch:(UIPinchGestureRecognizer *)pinch

{

    NSLog(@"识别到了捏合手势");

    pinch.view.transform = CGAffineTransformScale(pinch.view.transform, pinch.scale,pinch.scale);

    pinch.scale = 1;

}




转载请注明出处:http://blog.csdn.net/sevenquan