Closed yanxinmiao closed 8 years ago
The app:loadMoreFooterLayout
attribute you set in xml is an instance of LinearLayout
not LoadMoreFooterView
.
Force turn a LinearLayout object to LoadMoreFooterLayout the exception will be throw.
app:loadMoreFooterLayout="@layout/layout_irecyclerview_load_more_footer"
If you want to use LoadMoreFooterView
I wrote. You can copy layout_irecyclerview_load_more_footer.xml
I provided in the demo into your project.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity"> <com.aspsine.irecyclerview.IRecyclerView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/iRecyclerView" android:layout_width="match_parent" android:layout_height="match_parent" app:loadMoreEnabled="true" app:refreshEnabled="true" app:loadMoreFooterLayout="@layout/layout_irecyclerview_load_more_footer" app:refreshHeaderLayout="@layout/layout_irecyclerview_refresh_header" /> </LinearLayout>
this is MainActivity Layout xml
think you,The problem is solved.
loadMoreFooterView = (LoadMoreFooterView) iRecyclerView.getLoadMoreFooterView();
这行竟然报这个错误,什么情况