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
現有視圖,先前由 newView 回傳
- context
- Context
介面至應用程式的全域資訊
- cursor
- ICursor
用來取得資料的游標。 游標已經移動到正確位置。
- 屬性
例外狀況
若無法結合
備註
將所有傳入建構子「to」參數的欄位名稱與其對應的游標欄位綁定,並指定於「from」參數中。
結合分為兩個階段。 首先,如果有 a android.widget.SimpleCursorAdapter.ViewBinder , ViewBinder#setViewValue(android.view.View, android.database.Cursor, int) 則會被調用。 若回傳值為真,則表示已發生綁定。 若回傳值為假且綁定視圖為 TextView, #setViewText(TextView, String) 則會被呼叫。 如果回傳的值為假且綁定的視圖是 ImageView, #setViewImage(ImageView, String) 則會被呼叫。 若找不到合適的綁定,則擲出 a IllegalStateException 。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
另請參閱
- <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)>