首页 > PullToRefreshListView addHeaderView报 类型转换错误

PullToRefreshListView addHeaderView报 类型转换错误

Caused by: java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams cannot be cast to android.widget.AbsListView$LayoutParams

这个问题怎么解决啊


明显就是强转异常


你想添加的 headview 是个AbsListView的子类?


你的形参类型应该是:AbsListView.LayoutParams,但是实参类型是:RelativeLayout.LayoutParams

【热门文章】
【热门文章】