SimpleCursorAdapter.BindView(View, Context, ICursor) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将传递给构造函数的“to”参数的所有字段名称与“from”参数中指定的相应游标列绑定。
[Android.Runtime.Register("bindView", "(Landroid/view/View;Landroid/content/Context;Landroid/database/Cursor;)V", "GetBindView_Landroid_view_View_Landroid_content_Context_Landroid_database_Cursor_Handler")]
public override void BindView(Android.Views.View? view, Android.Content.Context? context, Android.Database.ICursor? cursor);
[<Android.Runtime.Register("bindView", "(Landroid/view/View;Landroid/content/Context;Landroid/database/Cursor;)V", "GetBindView_Landroid_view_View_Landroid_content_Context_Landroid_database_Cursor_Handler")>]
override this.BindView : Android.Views.View * Android.Content.Context * Android.Database.ICursor -> unit
参数
- view
- View
新视图之前返回的现有视图
- context
- Context
应用程序全局信息的接口
- cursor
- ICursor
要从中获取数据的游标。 光标已移动到正确的位置。
- 属性
例外
如果绑定无法发生,则为
注解
将传递给构造函数的“to”参数的所有字段名称与“from”参数中指定的相应游标列绑定。
绑定分为两个阶段。 首先,如果 android.widget.SimpleCursorAdapter.ViewBinder 可用, ViewBinder#setViewValue(android.view.View, android.database.Cursor, int) 则调用它。 如果返回的值为 true,则发生了绑定。 如果返回的值为 false,并且要绑定的视图为 TextView, #setViewText(TextView, String) 则调用。 如果返回的值为 false,并且要绑定的视图为 ImageView, #setViewImage(ImageView, String) 则调用。 如果找不到适当的绑定,则会引发一个 IllegalStateException 。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
适用于
另请参阅
- <xref:Android.Widget.CursorAdapter.BindView(Android.Views.View%2c+Android.Content.Context%2c+Android.Content.Context)>
- ViewBinder
- <xref:Android.Widget.SimpleCursorAdapter.SetViewImage(Android.Widget.ImageView%2c+System.String)>
- <xref:Android.Widget.SimpleCursorAdapter.SetViewText(Android.Widget.TextView%2c+System.String)>