DylanCaiCoding / LoadingStateView

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

用BaseActivity一直报错 #3

Closed ljackChen001 closed 4 years ago

ljackChen001 commented 4 years ago

java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to androidx.appcompat.widget.ActionBarOverlayLayout$LayoutParams

ljackChen001 commented 4 years ago

setContentView 只设置布局就会报错,必须要加入根布局的ID才可以

ljackChen001 commented 4 years ago

setToolbar("标题",NavIconType.BACK) 报错 Caused by: kotlin.TypeCastException: null cannot be cast to non-null type T

心累

DylanCaiCoding commented 4 years ago

java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to androidx.appcompat.widget.ActionBarOverlayLayout$LayoutParams

将主题设置成 NoActionBar 应该就没问题了,我有空排查下怎么造成的,这是 androidx 才有的,以前还是 support 版本时没有这个问题

DylanCaiCoding commented 4 years ago

setToolbar("标题",NavIconType.BACK) 报错 Caused by: kotlin.TypeCastException: null cannot be cast to non-null type T

心累

要注册一个 ViewType.TITLE 的全局适配器,适配器需要继承 BaseToolbarAdapter

DylanCaiCoding commented 4 years ago

我优化了基类代码和增加了注意事项的注释,你可以看下最新的代码