<iOS中的手势>

作者: 失忆的程序员 | 来源:发表于2016-05-10 18:58 被阅读9次

点击

UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap:)];

tap.numberOfTapsRequired = 1;

[imageView addGestureRecognizer:tap];

[tap release];


拖拽

UIPanGestureRecognizer *Pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(pan:)];

[imageView addGestureRecognizer:Pan];

[Pan release];


捏合

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

[(UIImageView *) imageView addGestureRecognizer:pinch];

[pinch release];


旋转

UIRotationGestureRecognizer *rotation = [[UIRotationGestureRecognizer alloc] initWithTarget:self action:@selector(rotation:)];

[imageView addGestureRecognizer:rotation];


UISwipeGestureRecognizer *swipe = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipe:)];

[imageView addGestureRecognizer:swipe];

[swipe release];


相关文章

网友评论

    本文标题:<iOS中的手势>

    本文链接:https://www.haomeiwen.com/subject/axpyrttx.html