android 修改listview item view 的方法

来源:互联网 发布:path软件 编辑:程序博客网 时间:2024/05/21 07:08

具体的解答办法很简单:

代码如下 :

1.获取需要更新的view

int visiblePosition = mListView.getFirstVisiblePosition();            View view = mListView.getChildAt(position - visiblePosition);            mListView.getAdapter().getView(position, view, mListView);
2.通过view,然后可以进行更新操作。

TextView tvStatus= (TextView) view.findViewById(R.id.status);TextView tvInfo = (TextView)view.findViewById(R.id.info);tvStatus.setText("需要更新的值");//set value .tvInfo.setText("latest value");//set value 
只需要通过这2个步骤,就可以进行listView  item进行更新。



1 0
原创粉丝点击