您需要在以下分配一个有效的枚举值:
[self.myFullScreenCollectionView scrollToItemAtIndexPath:a atScrollPosition:10 animated:NO];
这里第二个参数需要填充一个属于以下枚举UICollectionViewScrollPosition的整数:
typedef NS_OPTIONS(NSUInteger, UICollectionViewScrollPosition) {
UICollectionViewScrollPositionNone = 0,
// The vertical positions are mutually exclusive to each other, but are bitwise or-able with the horizontal scroll positions.
// Combining positions from the same grouping (horizontal or vertical) will result in an NSInvalidArgumentException.
UICollectionViewScrollPositionTop = 1 << 0,
UICollectionViewScrollPositionCenteredVertically = 1 << 1,
UICollectionViewScrollPositionBottom = 1 << 2,
// Likewise, the horizontal positions are mutually exclusive to each other.
UICollectionViewScrollPositionLeft = 1 << 3,
UICollectionViewScrollPositionCenteredHorizontally = 1 << 4,
UICollectionViewScrollPositionRight = 1 << 5
};
尝试使用这些标准枚举值之一,这可能会有所帮助。我认为 10 在这里无关紧要。