Skip to content
This repository was archived by the owner on Nov 29, 2022. It is now read-only.

customViewForEmptyDataSet in 1.8.1 #384

Closed
ICloud0114 opened this issue Jan 22, 2018 · 4 comments
Closed

customViewForEmptyDataSet in 1.8.1 #384

ICloud0114 opened this issue Jan 22, 2018 · 4 comments

Comments

@ICloud0114
Copy link

when I create CustomeView in customViewForEmptyDataSet delegate , there is nothing display

@dzenbot
Copy link
Owner

dzenbot commented Jan 24, 2018

Well, please share your implementation so someone can help you out.

@photos
Copy link

photos commented Feb 18, 2018

I'm facing the same issue. I'm creating a custom UIView and setting its frame to the frame size of my tableview and nothing appears.

@coderchou
Copy link

coderchou commented Jun 7, 2018

It use Autolayout, and the frame doesn't work
Maybe you need to create a subclass that inherits from UIView, and then override this method:
- (CGSize)intrinsicContentSize;


For example:

@interface CustomView : UIView

@end

@implementation CustomView

- (CGSize)intrinsicContentSize {
    return CGSizeMake(0, 300);
}
@end
- (UIView *)customViewForEmptyDataSet:(UIScrollView *)scrollView {
    CustomView *emptyView = [[CustomView alloc] init];
    emptyView.backgroundColor = [UIColor redColor];
    return emptyView;
}

it works like that:

test

@Tioks
Copy link

Tioks commented Feb 1, 2021

its work for me, thx!

@dzenbot dzenbot closed this as completed Feb 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants