我确实有一个具有 UIScrollView 的视图,并且在它上面有一个显示一些文本的视图。当用户在包含文本的视图上滑动时, UIScrollView 不会滚动。如何以将滑动手势中继到 UIScrollView 的方式使此视图透明。
谢谢
我确实有一个具有 UIScrollView 的视图,并且在它上面有一个显示一些文本的视图。当用户在包含文本的视图上滑动时, UIScrollView 不会滚动。如何以将滑动手势中继到 UIScrollView 的方式使此视图透明。
谢谢
你可以设置
myTextView.userInteractionEnabled = NO;
或者,如果您使用 Interface Builder 创建视图,那里有一个名为“启用用户交互”的复选框,只需取消选中即可。
返回包含指定点的视图层次结构(包括其自身)中接收器的最远后代。
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
Inside the -touchesXXXX:withEvent: methods of your custom view, call their super methods to forward touch events.
For example:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
// forward touchesBegan to super class
[super touchesBegan:touches withEvent:event];
...
// process touchesBegan for this view
}
Do the same things for touchesMoved, touchesEnded, and touchesCancelled.