今天这更有点迟了,让大家久等了。哈哈,今天好玩的又来了,我们来玩一玩,怎么把一张照片,旋转放大加移动。很期待吧,那么事不宜迟我们来实现它们。
说到这些功能,在ios中实现无非就是手势触摸功能,加上计算偏移,算出坐标。就ok了。非常的简单。
我们新建一个工程
#import "ViewController.h"
@interface ViewController ()<UIGestureRecognizerDelegate>
{
UIImageView *_imageView;
}
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self createImageView];
[self createPinchGesture];
[self createRotataeGesture];
// [self createPanGesture];
}
//创建缩放手势
-(void)createPinchGesture
{
UIPinchGestureRecognizer *pinchGes =[[UIPinchGestureRecognizer alloc]init];
pinchGes .delegate = self;
[pinchGes addTarget:self action:@selector(pinchGes:)];
[_imageView