Skip to content

emptyview显示时机不对的问题 #73

@CodeForYang

Description

@CodeForYang

在自动显示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后调用
}];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions