我希望有一个加载图标显示在RecyclerView的顶部,并在数据加载完成后消失
它看起来像:
谁能帮我吗?
我的代码显示了RecyclerView上方的TextView,显示“正在加载…”并在加载数据后消失,但RecyclerView仍然可见.
我的XML:
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/loaderTV"
android:text="Loading..."
android:layout_above="@+id/eventListRV"/>
android:scrollbars="vertical"
android:id="@+id/eventListRV"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/spinner">
然后在我的代码中
client.listCreators(request, new Callback>() {
@Override
public void success(ServiceResponse eventServiceResponse, Response response) {
eventList.addAll(eventServiceResponse.data.results);
Log.i("tag", String.valueOf(eventServiceResponse.data.total));
if (eventList.size() > 60) {
adapter.notifyDataSetChanged();
loadingText.setVisibility(View.GONE);
}
}
但我希望RecyclerView在数据加载时不可见,我希望在RecyclerView所在的进度条上面,我不希望它成为textview