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

use customView, DZN-_contentView's frame = (0,0,0,0) #408

Open stackJolin opened 6 years ago

stackJolin commented 6 years ago

use customView, DZN-_contentView's frame = (0,0,0,0)

chance395 commented 5 years ago

@stackJolin this DZN use auto layout so you set the frame did not work ,you can use masonry or others to layout ,give you a example

TimLin320 commented 5 years ago

@stackJolin this DZN use auto layout so you set the frame did not work ,you can use masonry or others to layout ,give you a example

  • (nullable UIView )customViewForEmptyDataSet:(UIScrollView )scrollView; { UIView testVIe =[UIView MAGetUIViewWithBackgroundColor:[UIColor redColor] superView:scrollView masonrySet:^(UIView currentView, MASConstraintMaker *make) { make.width.mas_equalTo(300); make.height.mas_equalTo(100); }]; return testVIe; }

It works for me, thanks!