1.pod 导入
2.导入头文件 #import "UIScrollView+EmptyDataSet.h"
3.继承代理 DZNEmptyDataSetDelegate,DZNEmptyDataSetSource
4.BaseTableView.m
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style{
self = [super initWithFrame:frame style:style];
if (self) {
self.emptyDataSetDelegate = self;
self.emptyDataSetSource = self;
self.tableFooterView = [UIView new];
}
return self;
}
- (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView{
return kColorWhite;
}
- (UIImage *)buttonImageForEmptyDataSet:(UIScrollView *)scrollView forState:(UIControlState)state{
return [UIImage imageNamed:@"login_icon_weibo"];
}
- (void)emptyDataSet:(UIScrollView *)scrollView didTapButton:(UIButton *)button{
//刷新页面
if (self.reloadBlock) {
self.reloadBlock();
}
}
网友评论