[英]recycle view does not update properly
嗨,大家好,我在2天的回收視圖中苦苦掙扎,我有一個片段,其中包括一個回收視圖,在這個片段中有一個對話框片段,我想在對話框關閉時取消回收視圖更新
這是對話框片段中的dissmiss方法的ovvrerid
somefragment fragment = new somefragment ();
var trance=Activity.SupportFragmentManager.BeginTransaction();
trance.Detach(fragment);
trance.Attach(fragment);
trance.Commit();
之后,我在onstart中獲得了新數據,並再次將其提供給適配器,當我檢查斷點時,一切都很好,但回收劑量仍未更新
list = await DownloadDataFromServer<List<Cilinic>>(uri + Handel.CurrentCityId);
myAdapter = new RecyclerAdapter(list);
myRecyclerView.SetAdapter(myAdapter);
myAdapter.NotifyDataSetChanged();
請幫幫我
嘗試將其添加到您的代碼中
RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
myRecyclerView.setLayoutManager(mLayoutManager);
myRecyclerView.setItemAnimator(new DefaultItemAnimator());
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.