UIPinchGestureRecognizer问题
我正在使用 UIPinchGestureRecognizer。我可以为捏入和捏出编写两个动作吗?有没有特定的方法(委托)?我只写了一个当我捏入时调用的方法...
UIPinchGestureRecognizer *pinchGesture = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinchGesture:)];
[self.view addGestureRecognizer:pinchGesture];
[pinchGesture release];
I am using UIPinchGestureRecognizer.can i write two action for pinch in and pinch out..is there any specific Method(delegate)?I have written only one it is called when i pinched in...
UIPinchGestureRecognizer *pinchGesture = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinchGesture:)];
[self.view addGestureRecognizer:pinchGesture];
[pinchGesture release];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在
-handlePinchGesture:
中检查手势的.scale
。如果是< 1,则为捏入,否则为捏出。You could check the gesture's
.scale
in-handlePinchGesture:
. If it is < 1, it is a pinch-in, otherwise is a pinch-out.