1
我想檢測拖動和觸摸uiimageview。 我該怎麼做? 我需要在圖像翻轉事件中實現這樣的代碼。 iOS 4.2: Flip image using block animationsUIImageView拖動和觸摸
我想檢測拖動和觸摸uiimageview。 我該怎麼做? 我需要在圖像翻轉事件中實現這樣的代碼。 iOS 4.2: Flip image using block animationsUIImageView拖動和觸摸
的阻力和觸摸爲您的圖片查看已分配GestureRecognizer
//drag your object
UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panDetected:)];
[self.imageSubVw addGestureRecognizer:panRecognizer];
// scale your object
UIPinchGestureRecognizer *pinchRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinchDetected:)];
[self.imageSubVw addGestureRecognizer:pinchRecognizer];
// rotate your object
UIRotationGestureRecognizer *rotationRecognizer = [[UIRotationGestureRecognizer alloc] initWithTarget:self action:@selector(rotationDetected:)];
[self.imageSubVw addGestureRecognizer:rotationRecognizer];
panRecognizer.delegate = self;
pinchRecognizer.delegate = self;
rotationRecognizer.delegate = self;