![](/img/trans.png)
[英]ListAdapter. getView return bad link of item from View(convertView)
[英]I need to remove the line where a button was clicked from a listadapter. Preferably from within the method getView. As I do this?
我的屏幕如下圖所示。
http://img146.imageshack.us/img146/1452/explicacao.jpg
它有一個TabHost Tab2,並且我有一個帶有列表的setAdapter,在這個列表中,我還有另一個帶有另一個列表的setAdapter,如圖所示。 需要,當您按下按鈕(Remove)時,將刪除此行,將位置移至最下面一行,即最下面一行。.我設法完成了此usarno view.setVisibility(View.INVISIBLE),該行消失了,但是空間仍然存在。
在方法getView()內執行此操作會很有趣,該方法將刪除該項目的列表。
我正在問的是ArrayList object.remove == true中的getView(...)
view.setVisibility (View.INVISIBLE)
如果沒有,我返回視圖;
更像這樣:
view = convertView;
if (view == null) {
LayoutInflater inflater = (LayoutInflater) context.getSystemService
(Context.LAYOUT_INFLATER_SERVICE);
view = inflater.inflate
(R.layout.lista_linhas_fiscalizacao, null);
}
if (object.remove == false) {
Do something ... else {}
view.setVisibility (View.INVISIBLE);
}
有任何想法嗎?
謝謝。
當您想要執行此操作時...調用yourAdapter.notifyDataSetChanged()
此方法,..它將刷新您的列表
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.