我有一个UIView
覆盖子类的UITableview
. 问题是,我无法让表格视图滚动。我尝试过覆盖touchesBegan
, touchesMoved
, touchesEnded
. 然后我尝试覆盖 hittest 但这似乎没有影响。
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
CGPoint touchPoint = [touch locationInView:self];
NSLog(@"SMTable.touches began %@",NSStringFromCGPoint(touchPoint));
[super touchesBegan:touches withEvent:event];
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touches anyObject];
CGPoint touchPoint = [touch locationInView:self];
NSLog(@"SMTable.touches moved %@ for :%p",NSStringFromCGPoint(touchPoint),touch.view);
[super touchesMoved:touches withEvent:event];
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touches anyObject];
CGPoint touchPoint = [touch locationInView:self];
NSLog(@"SMTable.touches ended %@",NSStringFromCGPoint(touchPoint));
[super touchesEnded:touches withEvent:event];
}
- (void)touchesCancelled:(NSSet*)touches withEvent:(UIEvent*)event {
[super touchesCancelled:touches withEvent:event];
}
- (UIView*) hitTest:(CGPoint)point withEvent:(UIEvent *)event {
//NSLog(@"SMTable.hitTest %@",NSStringFromCGPoint(point));
return [super hitTest:point withEvent:event];
}