苹果的bug?没有调用UICollectionView targetContentOffsetForProposedContentOffset
问题描述:
我在*上看到其他问题,说我需要确保分页设置为关闭。但我已经这样做了,仍然没有被调用。苹果的bug?没有调用UICollectionView targetContentOffsetForProposedContentOffset
有什么我不见了吗?
以下是Github上的示例项目。除了设置集合视图的代码外,其中没有代码。
这里是代码:
func collectionView(collectionView: UICollectionView, targetContentOffsetForProposedContentOffset proposedContentOffset: CGPoint) -> CGPoint {
return proposedContentOffset
}
答
答
您可能会isPagingEnabled
集想着targetContentOffset(forProposedContentOffset:withScrollingVelocity:)
override func targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint, withScrollingVelocity velocity: CGPoint) -> CGPoint {
var contentOffset = proposedContentOffset
// do something with contentOffset
return contentOffset
}
假的集合视图。