Android7.0中文文档(API) -- Adapter

完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/Adapter.html

Adapter

public interface Adapter

android.widget.Adapter


An Adapter object acts as a bridge between an AdapterView and the underlying data for that view. The Adapter provides access to the data items. The Adapter is also responsible for making a View for each item in the data set.
一个Adapter对象充当AdapterView和视图的潜在数据之间的一个桥梁。Adapter提供了对数据项的访问。Adapter还负责对数据集中的每个项创建View

摘要


常量

intIGNORE_ITEM_VIEW_TYPE

An item view type that causes the AdapterView to ignore the item view.
项的视图类型,它会导致AdapterView忽略项的视图。

intNO_SELECTION

Public methods

abstract intgetCount()

How many items are in the data set represented by this Adapter.
这个Adapter的数据集中有多少项。

abstract ObjectgetItem(int position)

Get the data item associated with the specified position in the data set.
获取数据集中指定位置相关联的数据项。

abstract longgetItemId(int position)

Get the row id associated with the specified position in the list.
获取列表中指定位置相关联的行ID。

abstract intgetItemViewType(int position)

Get the type of View that will be created by getView(int, View, ViewGroup) for the specified item.
获取视图的类型,将通过getView(int, View, ViewGroup),为指定的项创建视图。

abstract ViewgetView(int position, View convertView, ViewGroup parent)

Get a View that displays the data at the specified position in the data set.
获取一个视图,它将显示数据集中指定位置的数据。

abstract intgetViewTypeCount()

Returns the number of types of Views that will be created by getView(int, View, ViewGroup).
返回视图类型的数量,将通过getView(int, View, ViewGroup),来创建视图。

abstract booleanhasStableIds()

Indicates whether the item ids are stable across changes to the underlying data.
在改变底层数据时,项的id是否是不变的。

abstract booleanisEmpty()
abstract voidregisterDataSetObserver(DataSetObserver observer)

Register an observer that is called when changes happen to the data used by this adapter.
注册一个监视器,当这个适配器使用的数据发生变化时,会被调用。

abstract voidunregisterDataSetObserver(DataSetObserver observer)

Unregister an observer that has previously been registered with this adapter via registerDataSetObserver(DataSetObserver).
注销一个监视器,它在此适配器上一次调用registerDataSetObserver(DataSetObserver)时注册的。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值