dzenbot / DZNEmptyDataSet

A drop-in UITableView/UICollectionView superclass category for showing empty datasets whenever the view has no content to display
https://www.cocoacontrols.com/controls/dznemptydataset
MIT License
12.09k stars 1.73k forks source link

- (UIView *)customViewForEmptyDataSet:(UIScrollView *)scrollView not work. #370

Open jjzjx118 opened 6 years ago

jjzjx118 commented 6 years ago

I use the version 1.8.1 and below is my code: - (UIView *)customViewForEmptyDataSet:(UIScrollView *)scrollView{ UIView * view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 100, 100)]; view.backgroundColor = [UIColor redColor]; return view; }

and there just an empty "DZNEmptyDataSetView" shows on my tableView

hssdx commented 6 years ago

Because lose one constraints

search code: [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[contentView]|" options:0 metrics:nil views:@{@"contentView": self.contentView}]];

then inset code: [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[contentView]|" options:0 metrics:nil views:@{@"contentView": self.contentView}]];

or use my git source pod 'DZNEmptyDataSet', :git => 'https://github.com/hssdx/DZNEmptyDataSet.git', branch => 'master'

hell03W commented 6 years ago

Thank you, it works!

feng-zhang0712 commented 6 years ago

nice

aashouwang commented 6 years ago

Thank you, you saved me!

zhangxiongwen commented 5 years ago

Thank you!