如何在多个 UIImageView 上使用平移手势
我开发的应用程序有很多视图,但是当我想使用平移手势移动某些视图(backgndView)时,另一个视图被移动。看来我想要的视图未激活。这是代码。
//---pan gesture---
UIPanGestureRecognizer *panGesture =
[[UIPanGestureRecognizer alloc]
initWithTarget:self
action:@selector(handlePanGesture:)];
[backgndView addGestureRecognizer:panGesture];
[frameView addGestureRecognizer:panGesture];
[effectView addGestureRecognizer:panGesture];
[itemView addGestureRecognizer:panGesture];
[extraView addGestureRecognizer:panGesture];
[panGesture release];
我认为 extraView 对手势有效,但对其他视图无效。还有其他方法可以使选定的视图处于活动状态吗?
谢谢。
I develop app that have many view but when i want to move certain view (backgndView) using pan gesture, the other view was moved. Seem my desired view not active. Here the code.
//---pan gesture---
UIPanGestureRecognizer *panGesture =
[[UIPanGestureRecognizer alloc]
initWithTarget:self
action:@selector(handlePanGesture:)];
[backgndView addGestureRecognizer:panGesture];
[frameView addGestureRecognizer:panGesture];
[effectView addGestureRecognizer:panGesture];
[itemView addGestureRecognizer:panGesture];
[extraView addGestureRecognizer:panGesture];
[panGesture release];
I think extraView is active for gesture but not other view. Any other way to make selected view active?
thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不太理解问题,但像打击这样的东西会使所有视图都针对平移手势活跃。
//---平移手势---
Didnt understand problem well but something like blow makes all views active for pan gesture.
//---pan gesture---