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

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

public class ArrayAdapter
extends BaseAdapter implements Filterable, ThemedSpinnerAdapter

java.lang.Object
   ↳android.widget.BaseAdapter
    ↳android.widget.ArrayAdapter<T>


A concrete BaseAdapter that is backed by an array of arbitrary objects. By default this class expects that the provided resource id references a single TextView. If you want to use a more complex layout, use the constructors that also takes a field id. That field id should reference a TextView in the larger layout resource.
一个由任意对象数组支持的具体的BaseAdapter。默认情况下,这个类希望通过所提供的资源id来引用一个TextView。如果你想要使用更复杂的布局,请使用包含id字段的构造函数。该id字段应该在较大的布局资源中引用TextView。

However the TextView is referenced, it will be filled with the toString() of each object in the array. You can add lists or arrays of custom objects. Override the toString() method of your objects to determine what text will be displayed for the item in the list.
但是,引用的TextView将由数组中的每个对象的toString()方法来填充。你可以添加列表或自定义对象的数组。重载你的对象的toString()方法,以决定为列表中的项显示什么文本。

To use something other than TextViews for the array display, for instance, ImageViews, or to have some of data besides toString() results fill the views, override getView(int, View, ViewGroup) to return the type of view you want.
要在除了TextView之外的其他控件中显示数组,例如,ImageView,或者除toString()之外的一些数据来填充视图,重载getView(int, View, ViewGroup),以返回你想要的视图类型。

摘要


继承常量

From interface android.widget.Adapter

Public构造方法

ArrayAdapter(Context context, int resource)

Constructor
构造方法

ArrayAdapter(Context context, int resource, int textViewResourceId)

Constructor
构造方法

ArrayAdapter(Context context, int resource, T[] objects)

Constructor
构造方法

ArrayAdapter(Context context, int resource, int textViewResourceId, T[] objects)

Constructor
构造方法

ArrayAdapter(Context context, int resource, List<T> objects)

Constructor
构造方法

ArrayAdapter(Context context, int resource, int textViewResourceId, List<T> objects)

Constructor
构造方法

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值