android 中文api (63) —— SimpleAdapter.ViewBinder


 

前言

  本章内容是 android.widget.SimpleAdapter.ViewBinder,版本为Android 2.3 r1,翻译来自"德罗德",欢迎大家访问他的博客:http://sparkrico.javaeye.com,再次感谢"德罗德" !期待你一起参与Android中文API的翻译,联系我over140@gmail.com。

 

声明

  欢迎转载,但请保留文章原始出处:)

    博客园:http://www.cnblogs.com/

    Android中文翻译组:http://code.taobao.org/project/view/404/

 

正文

  一、结构

 

public static interface SimpleAdapter.ViewBinder

 

android.widget.SimpleAdapter.ViewBinder

 

 

  二、概述

     SimpleAdapter的外部数据(external clients)可以使用这个类将值绑定到视图。你应该用这个类绑定值到那些不能直接通过SimpleAdapter支持的视图,或者改变通过SimpleAdapter支持绑定的方法的视图。

  (译者注:如果SimpleAdapter设置了ViewBinder则使用Viewbinder的绑定规则,否则使用SimpleAdapter的默认绑定规则)

 

 

  三、公共方法

 

public abstract boolean setViewValue (View view, Object data, String textRepresentation)

绑定指定数据到指定的视图。 当通过调用ViewBinder绑定数据时,此方法必须返回真。如果这个方法返回假,SimpleAdapter将尝试通过其内部默认的方法绑定数据。

       参数

              view       要绑定数据的视图

data        要绑定到视图的数据

textRepresentation     一个表示所支持数据的安全的字符串:结果是data.toString()或者空字符串,但不会是null

              返回值

                     如果数据绑定到视图返回真,否则返回假。

 

 

 

  四、补充

 

 

 

  五、相关章节

    Android 中文API (46) —— SimpleAdapter

 

 

posted @ 2010-12-15 09:29  农民伯伯  阅读(3993)  评论(1编辑  收藏  举报