天天看點

android:ListView:convertView.setTag()來設定資料

void android.view.View.setTag(Object tag)

Since: API Level 1

Sets the tag associated with this view. A tag can be used to mark a view in its hierarchy and does not have to be unique within the hierarchy. Tags can also be used to store data within a view without resorting to another data structure.

an Object to tag the view with

also see

<code>getTag()</code>

<code>setTag(int, Object)</code>

android:ListView:convertView.setTag()來設定資料
android:ListView:convertView.setTag()來設定資料

設一個holder類

android:ListView:convertView.setTag()來設定資料
android:ListView:convertView.setTag()來設定資料

即可。

本文轉自老Zhan部落格園部落格,原文連結:http://www.cnblogs.com/mybkn/archive/2012/05/22/2512491.html,如需轉載請自行聯系原作者

繼續閱讀