我在iOS8上测试一个适用于iOS7的应用程序。似乎函数" scrollToItemAtIndexPath:atScrollPosition:animated:"不适用于iOS8。
这是我使用它的功能。
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
if([collectionView isEqual:m_CollectionViewSequence])
[m_CollectionViewSequence scrollToItemAtIndexPath:indexPath atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:YES];
}