語言

ListView.SetSelection(Int32) 方法

定義

設定目前選取的項目。

[Android.Runtime.Register("setSelection", "(I)V", "GetSetSelection_IHandler")]
public override void SetSelection(int position);
[<Android.Runtime.Register("setSelection", "(I)V", "GetSetSelection_IHandler")>]
override this.SetSelection : int -> unit

參數

position
Int32

從 0 開始的索引,指待選取的資料項目。

屬性

備註

設定目前選取的項目。 若處於觸控模式,該物品不會被選取,但仍會被正確擺放。 若指定的選擇位置小於0,則會選擇位置0的項目。

Java 文件 android.widget.ListView.setSelection(int)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於