DZNEmptyDataSet
DZNEmptyDataSet copied to clipboard
the custom view cannot respond to the click event.
- (UIView *)customViewForEmptyDataSet:(UIScrollView *)scrollView { CustomView *view = [[CustomView allol] init]; return view; }
frame of the customView is zero, so that it cannot respond to the click event.
modify method in UIScrollView+EmptyDataSet.m '- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { UIView *hitView = [super hitTest:point withEvent:event];
// Return any UIControl instance such as buttons, segmented controls, switches, etc. if ([hitView isKindOfClass:[UIControl class]]) { return hitView; }
// Return either the contentView or customView if ([hitView isEqual:_contentView] || [hitView isEqual:_customView]) { return hitView; } if ([hitView isKindOfClass:[DZNEmptyDataSetView class]]) { return hitView; } return nil; } '
the custom view does not show, why?
- (UIView *)customViewForEmptyDataSet:(UIScrollView *)scrollView { UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 375, 200)]; v.backgroundColor = [UIColor redColor]; return v; }
i have find a solution. it works for me
@KeymonWong how to get it
I think v1.6.1 is easy to use. v1.8.1 is not kind for me:)