我有一個UIView
覆蓋子類UITableview
。問題是,我不能讓tableview滾動。我試過壓倒touchesBegan
,touchesMoved
,touchesEnded
。然後我試圖覆蓋hittest,但似乎沒有任何影響。觸摸UITableview事件
-(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];
}
overlayView.userInteractionEnabled = NO; –