简体   繁体   English

是否可以在SubView中而不是在parentView中调用TouchesBegan,touchesMoved和touchesEnded?

[英]Is it possible to call the TouchesBegan, touchesMoved and touchesEnded in SubView, and not in parentView?

My problem is that the touchesBegan, touchesMoved and touchesEnded is taking the focus of : 我的问题是,touchesBegan,touchesMoved和touchesEnded正在关注:

- (void)didSelectWithTableView:(UITableView *)tableView controller:(UIViewController *)controller
{
...
}

in a tableview click. 在表格视图中单击。 So didSelectWithTableView is never called... 所以didSelectWithTableView永远不会被调用...

Is it possible to have a subView (in popover) that is handled by touchesBegan, touchesMoved and touchesEnded, but not the parent View ? 是否可以有一个由touchesBegan,touchesMoved和touchesEnded处理但不在父级View中处理的subView(在弹出窗口中)?

Just call the super implementation of the methods. 只需调用方法的超级实现即可。 Along with your override code. 以及您的替代代码。

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [super touchesBegan:touches withEvent:event];
    ...
}

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
    [super touchesMoved:touches withEvent:event];
    ...
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
    [super touchesEnded:touches withEvent:event];
    ...
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 touches开始,touchedmoved,touchesended问题 - touchesbegan, touchesmoved, touchesended issue touchesBegan,touchesEnded,touchesMoved移动UIView - touchesBegan, touchesEnded, touchesMoved for moving UIView 滑动然后按住-触摸开始/触摸已移动/触摸结束 - Swipe then hold - touchesBegan/touchesMoved/touchesEnded UIGestureRecognizers与touchesBegan / touchesMoved / touchesEnded(准确度) - UIGestureRecognizers vs touchesBegan/touchesMoved/touchesEnded (accuracy) 开始使用touches,touchedmoved和touchedext不能使拖动动画流畅 - Using touchesbegan, touchesmoved and touchesended is not animating the dragging smoothly 如何检测touchesBegan,touchesMoved,touchesEnded来自另一个类的事件 - How to detect touchesBegan, touchesMoved, touchesEnded events from another class 在UIView(子类)中监听方法(touchesBegan,touchesMoved,touchesEnded),而不是父UIViewController吗? - Listen to methods (touchesBegan, touchesMoved, touchesEnded) in UIView (subclass) and not parent UIViewController? 为什么UIViewController touchesBegan,touchesMoved&touchesEnded仅在两个触摸的第一个开始,移动或结束时被调用? - Why are UIViewController touchesBegan, touchesMoved & touchesEnded only being called when the first of two touches begins, moves or ends? 什么时候“手指”事件作为手势发送到UIGestureRecognizer与touchesBegan / touches已移动/ touches结束到UIView - When do “finger” events get sent as Gestures to UIGestureRecognizer vs touchesBegan/touchesMoved/touchesEnded to UIView 无法在iOS中的viewController中调用touchesBegan / touchesMoved方法 - Unable to call touchesBegan/touchesMoved method inside viewController in iOS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM