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);
}
为什么只有一个图片响应 = =
viewgroup中加子控件的问题
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
1条回答 默认 最新
- danielinbiti 2015-01-26 14:49关注
1、没看到你v怎么加进去的。
2、对于同一个layout中,如果有同一个id,最好把id值通过setId把Id值变成不同。解决 无用评论 打赏 举报