考虑到低耦合, 所以自定义缺省页需要导入第三方组件依赖(点击链接按照文档依赖), 当然如果你使用其他方式处理缺省页可以跳过本章. 1. 依赖 [StateLayout](https://github.com/liangjingkanji/StateLayout) 1. 依赖 [BRV](https://github.com/liangjingkanji/BRV) (因为BRV包含StateLayout, 同时BRV支持Net自动下拉刷新/分页加载)
创建缺省页 ```xml ``` 自动显示缺省页 ```kotlin state.onRefresh { scope { tv_fragment.text = Get("api").await() } }.showLoading() ``` ## 生命周期 |生命周期|描述| |-|-| |开始|StateLayout执行`showLoading`后触发`onRefresh`, 然后开始网络请求| |结束|缺省页被销毁(例如其所在的Activity或Fragment被销毁), 网络请求自动取消|