手势
来源:互联网 发布:数据恢复吧 编辑:程序博客网 时间:2024/05/01 16:32
// 手势
// 点击
// UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAciton:)];
// tap.numberOfTapsRequired = 2;
// tap.numberOfTouchesRequired = 2;
// [imageView addGestureRecognizer:tap];
// [tap release];
// 长按
UILongPressGestureRecognizer *longPress= [[UILongPressGestureRecognizeralloc] initWithTarget:selfaction:@selector(longPressAction:)];
[imageView addGestureRecognizer:longPress];
[longPress release];
longPress.minimumPressDuration =1;
longPress.allowableMovement = 200;
// longPress.numberOfTapsRequired = 2; // 双击之后长按
// longPress.numberOfTouchesRequired = 2;
// 轻扫
// UISwipeGestureRecognizer *swipeRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeAction:)];
// [imageView addGestureRecognizer:swipeRight];
// [swipeRight release];
// swipeRight.direction = UISwipeGestureRecognizerDirectionRight;
// UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeAction:)];
// [imageView addGestureRecognizer:swipeLeft];
// [swipeLeft release];
// swipeLeft.direction = UISwipeGestureRecognizerDirectionLeft;
// UISwipeGestureRecognizer *swipeUp = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeAction:)];
// [imageView addGestureRecognizer:swipeUp];
// [swipeUp release];
// swipeUp.direction = UISwipeGestureRecognizerDirectionUp;
// UISwipeGestureRecognizer *swipeDown = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeAction:)];
// [imageView addGestureRecognizer:swipeDown];
// [swipeDown release];
// swipeDown.direction = UISwipeGestureRecognizerDirectionDown;
// 旋转
// UIRotationGestureRecognizer *rotation = [[UIRotationGestureRecognizer alloc] initWithTarget:self action:@selector(rotationAction:)];
//
// [imageView addGestureRecognizer:rotation];
// [rotation release];
//
// 捏合
UIPinchGestureRecognizer *pinch = [[UIPinchGestureRecognizeralloc] initWithTarget:selfaction:@selector(pinchAction:)];
[imageView addGestureRecognizer:pinch];
[pinch release];
//pinch.scale 放大缩小的倍数
//
// 拖拽
UIPanGestureRecognizer *pan = [[UIPanGestureRecognizeralloc] initWithTarget:selfaction:@selector(panAction:)];
[imageView addGestureRecognizer:pan];
[pan release];
- 手势
- 手势
- 手势
- 手势
- 手势
- 手势
- 手势
- 手势
- 手势
- 手势
- 手势
- 手势
- 手势
- 手势
- 手势
- 手势
- 手势
- 手势
- View的一些小知识
- Item 7:当创建对象的时候,区分()和{}的使用
- KFC系列之 - Oracle DBA入门MYSQL(上)已发布!
- Qt使用教程之使用Qt Quick UI表单(一)
- MySQL binlog 组提交与 XA(两阶段提交)
- 手势
- 第4讲项目2——完成简单计算(2)
- Java中的堆和栈的区别
- RtlEqualUnicodeString routine
- test
- [从头学数学] 第74节 小数乘法
- C++11~综述
- pyqt实现CSDN博客访客数编程自动化增加GUI
- Item 8: 比起0和NULL更偏爱nullptr