UICollectionView.SelectItem 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
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
專案在捲動完成之後應該放置於何處。
- 屬性
備註
如果 AllowsSelection 為 false
,這個方法就不會執行任何動作。 如果 AllowsMultipleSelection 是 false
,這個方法會取消選取目前選取的專案。
這個方法不會觸發對任何選取相關委派方法的呼叫, (例如 ItemSelected(UICollectionView, NSIndexPath) 或 ItemDeselected(UICollectionView, NSIndexPath)) 。