DylanCaiCoding / LoadingStateView

Decoupling the code of toolbar or loading status view. (深度解耦标题栏,解耦加载中、加载失败、无数据等缺省页,支持两行代码集成到基类)
Apache License 2.0
676 stars 53 forks source link

切换布局时获取不到view #11

Closed DuShuYuan closed 3 years ago

DuShuYuan commented 3 years ago

比如 showLoadingView 后 获取 contentView 中的recyclerView 就报错 100%报错 代码: override fun initView() { showLoadingView() rec.layoutManager = LinearLayoutManager(mContext) } 报错 java.lang.IllegalStateException: rec must not be null

DylanCaiCoding commented 3 years ago

切换状态是用 removeView 和 addView 的方式实现的,建议 showLoadingView() 在请求的时候才调用