SimpleAdapter

public classSimpleAdapter
extends BaseAdapter implements Filterable
java.lang.Object
android.widget.BaseAdapter
↳android.widget.SimpleAdapter


Class Overview概观,总的看法

An easy adapter to map static data to views defined in an XML file.You can specify the data backing the list as an ArrayList of Maps.Each entry入口 in the ArrayList corresponds to相对应 one row in the list. The Maps contain the data for each row.You also specify an XML file that defines the views used to display the row , and a mapping from keys in the Map to specific特定的、明确的 views . Binding data to views occurs出现 in two phases阶段. First , if a SimpleAdapter.ViewBinder is available [əˈveləbəl], setViewValue(android.view.View, Object, String) is invokedinvoke引用. If the returned value is true, binding har occurred. If the returned is false, the following views are then tried in order有次序.

  • A View that implements Checkable (e.g.CheckBox). The expected bind value is boolean.
  • TextView. The expected bind value is a string and setViewText(TextView, String) is invoked.
  • ImageView.The expected bind value is a resource id or a string and setViewImage(ImageView, int) or setViewImage(ImageView, String) is invoked.

Summary 摘要,概要; 总结,一览

Nested嵌套的 classes
interface SimpleAdapter.ViewBinder This class can be used by external clients of SimpleAdapter to bind values to views.
public constructors
SimpleAdapter(Context context, List<? extends Map<String, ?>> data, int resource, String[] from, int[] to)

  • context The context where the view associated联系、联想、结合 with this SimpleAdapter is running.
  • data a List of Maps. Each entry in the List corresponds to one row in the list.

未完待续...

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容