我想有上顯示的其中一個RecyclerView是頂部裝載的圖標,然後消失一旦數據被加載完成設置進度條和數據後刪除加載
它看起來像:
誰能幫助我嗎?
我的代碼顯示了RecyclerView上方的TextView,它顯示「Loading ...」並在數據加載後消失,但RecyclerView仍然可見。
我的XML:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/loaderTV"
android:text="Loading..."
android:layout_above="@+id/eventListRV"/>
<android.support.v7.widget.RecyclerView
android:scrollbars="vertical"
android:id="@+id/eventListRV"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/spinner">
</android.support.v7.widget.RecyclerView>
然後在我的代碼
client.listCreators(request, new Callback<ServiceResponse<Event>>() {
@Override
public void success(ServiceResponse<Event> 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的數據加載時是不可見的,我想在進度條ontop的的RecyclerView其中是,我不希望它成爲一個文本視圖
工作,除了進度條不居中 – 2015-03-02 21:49:03
好吧它的中心現在,除了加載圖標是巨大的!我想我可以找出一種方法來使它更小 – 2015-03-02 21:51:30
當我使用notifyDataSetChanged'''用戶界面凍結,並且'''progressBar''停止:http://stackoverflow.com/questions/ 41945734/recyclerview與 - 100項加載太緩慢 – JCarlos 2017-01-31 03:39:43