[英]Uniquely identify an item's element in ListView
您能幫我如何找到特定項目的textView嗎? 例如,我有一個包含某些項目的listView,每個項目都由3個textViews(名稱,價格,描述)組成。 現在,我想使用和updateView(int index)方法更改“價格” textView的值。 如何在正確的項目中識別正確的textView?
假設我有5個項目(product1,...,product5)。 現在我想更新第三種產品(product3)的價格。 updateView(3)
我調用了updateView(3)
我的updateView(int index)方法
private void updateView(int index){
// thats how I get the row
View v = lvProduct.getChildAt(index);
// now I want to find the tvPrice in that row
// but I'm not sure how to go about this
}
任何提示將是偉大的:D
我通常采用的方法是執行以下操作:
我希望這有幫助!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.