for(ProductInCart item : products){
View v =View.inflate(getContext(), R.layout.cart_product_item, this);
ViewGroup cartVg = (ViewGroup) this.getChildAt(this.getChildCount() - 1);
pic = v.findViewById(R.id.cart_item_pic);
pic.setOnClickListener(this);
}
为什么只有一个图片响应 = =
1、没看到你v怎么加进去的。
2、对于同一个layout中,如果有同一个id,最好把id值通过setId把Id值变成不同。