emptyview显示时机不对的问题
CodeForYang opened this issue · comments
在自动显示emptyView的情况下,
如果在ly_startLoading 和 发送请求之前触发了[tableview reloadData],
比如layoutSubviews ->[tableview reloadData]
会出现 ly_startLoading设置被覆盖,emptyView会显示出来
代码类似这样
//网络请求时调用
[self.tableView ly_startLoading];
[self.tableView reloadData];
//这里面是网络请求
[super loadDataWithFinish:^{
//回调到这里,网络请求结束,tableview已经reloadData
[self.tableView ly_endLoading];//必须保证在reloadData后调用
}];