Adapter getview中的Tag 、convertView理解



android SDK中这样讲getview的参数 convertview :
the old view to reuse, if possible. 
Note: You should check that this view is non-null and of an appropriate type before using.

 If it is not possible to convert this view to display the correct data, this method can create a new view.


view的重用。注意:在使用之前你应该注意convertView是否为空、是否是自己需要的view类型。如果不能用它恰当的显示数据,这个方法将创建一个新的view。


tag

Unlike IDs, tags are not used to identify views. Tags are essentially an extra piece of information that can be associated with a view. They are most often used as a convenience to store data related to views in the views themselves rather than by putting them in a separate structure.

 不像id,不用tags来标识view。tags是view重要的一部分。它们通常被用来保存和它们所在view本身相关的数据。这样要比view存它们的数据在一个特殊的数据结构方便的多。








  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值