ios - UIPinchGestureRecognizer in UIView is not working properly -
i trying zoom-in , zoom-out in uiview
using uipinchgesturerecognizer
. when pinch on trackpad, not recognising pinch , control not going twofingerpinch
function. using following code.
- (void)viewdidload { //....... uipinchgesturerecognizer *twofingerpinch = [[uipinchgesturerecognizer alloc] initwithtarget:self action:@selector(twofingerpinch:)]; [myview addgesturerecognizer:twofingerpinch]; //..... } - (void)twofingerpinch:(uipinchgesturerecognizer *)recognizer { nslog(@"pinch scale: %f", recognizer.scale); if (recognizer.scale >1.0f && recognizer.scale < 2.5f) { cgaffinetransform transform = cgaffinetransformmakescale(recognizer.scale, recognizer.scale//); myview.transform = transform; } }
why not recognising pinch trackpad? there other method same?
first click on option button. 2 gray spots can move using mouse or trackpad. in older versions need press shift+option.
for more details check this.
Comments
Post a Comment