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)) 。