共用方式為


UICollectionView.SelectItem 方法

定義

UICollectionViewCell選取 ,並選擇性地捲動,使其可見。

[Foundation.Export("selectItemAtIndexPath:animated:scrollPosition:")]
public virtual void SelectItem (Foundation.NSIndexPath indexPath, bool animated, UIKit.UICollectionViewScrollPosition scrollPosition);
abstract member SelectItem : Foundation.NSIndexPath * bool * UIKit.UICollectionViewScrollPosition -> unit
override this.SelectItem : Foundation.NSIndexPath * bool * UIKit.UICollectionViewScrollPosition -> unit

參數

indexPath
NSIndexPath

NSIndexPath所需專案的 。

animated
Boolean

true 如果選取範圍變更應該以動畫顯示,則為 。

scrollPosition
UICollectionViewScrollPosition

專案在捲動完成之後應該放置於何處。

屬性

備註

如果 AllowsSelectionfalse ,這個方法就不會執行任何動作。 如果 AllowsMultipleSelectionfalse ,這個方法會取消選取目前選取的專案。

這個方法不會觸發對任何選取相關委派方法的呼叫, (例如 ItemSelected(UICollectionView, NSIndexPath)ItemDeselected(UICollectionView, NSIndexPath)) 。

適用於