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

滚动完成后应放置项的位置。

属性

注解

如果 AllowsSelection 为 , false则此方法不执行任何作用。 如果 AllowsMultipleSelectionfalse,则此方法取消选择当前选定的元素。

此方法不会触发对任何与选择相关的委托方法的调用, (例如 ItemSelected(UICollectionView, NSIndexPath)ItemDeselected(UICollectionView, NSIndexPath)) 。

适用于