项目介绍:
https://github.com/storm52/BTViewState
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
使用
设置默认状态图片与提示
[BTViewStateProperty setImageNoData:[UIImage imageNamed:@"Common_problem_none records"] error:[UIImage imageNamed:@"Common_problem_no data"] network:[UIImage imageNamed:@"Common_problem_network"]];
[BTViewStateProperty setTitleNoData:@"暂无记录" error:@"失败" network:@"网络错误"];
指定视图状态
self.view.viewState = BTViewStateLoading;
tableView.viewState = BTViewStateLoading;
button.viewState = BTViewStateLoading;
更多视图属性设置
tableView.stateProperties.loadingAreaInsets = UIEdgeInsetsMake(152, 0, 0, 0);
tableView.stateProperties.contentVerticalOffset = -75;
tableView.stateProperties.noDataActionBlock = ^{
[weakSelf reloadData];
};
view.stateProperties.labelOffset = -20;
[tableView.stateProperties setImage:UIImage.new forLoadState:BTViewStateNoData];
更多等……你探索
Author
liuwuxiong@btb.com