DZNEmptyDataSet icon indicating copy to clipboard operation
DZNEmptyDataSet copied to clipboard

the custom view cannot respond to the click event.

Open youlookdelicious opened this issue 6 years ago • 5 comments

  • (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.

youlookdelicious avatar May 03 '18 10:05 youlookdelicious

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; } '

yanyanforest avatar Jun 13 '18 08:06 yanyanforest

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; }

image

KeymonWong avatar Jun 14 '18 11:06 KeymonWong

i have find a solution. it works for me

KeymonWong avatar Jun 14 '18 12:06 KeymonWong

@KeymonWong how to get it

stackJolin avatar Aug 08 '18 03:08 stackJolin

I think v1.6.1 is easy to use. v1.8.1 is not kind for me:)

kirinzer avatar Sep 03 '18 10:09 kirinzer