Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UICollectionView #82

Open
ShannonChenCHN opened this issue Aug 4, 2017 · 4 comments
Open

UICollectionView #82

ShannonChenCHN opened this issue Aug 4, 2017 · 4 comments

Comments

@ShannonChenCHN
Copy link
Owner

No description provided.

@ShannonChenCHN
Copy link
Owner Author

ShannonChenCHN commented Aug 4, 2017

文档

开源项目

文章

WWDC

演讲🗣

书籍

FAQ

@ShannonChenCHN
Copy link
Owner Author

ShannonChenCHN commented Jan 5, 2018

常见问题 1:iOS 11 中, UICollectionView 的 scroll indicator 会被 section header 遮住

解决方案:将 section header 的 zIndex 设为 0。

参考:

@ShannonChenCHN
Copy link
Owner Author

ShannonChenCHN commented Jan 22, 2018

常见问题 2:如何实现 UICollectionView 的以 cell 宽度为页宽的 Paging 效果(而不是以屏幕宽度为页宽)?

问题:设置 pagingEnabled 属性只能实现 以屏幕宽度为页宽 的paging 效果。

解决方案一:重写 - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset 方法,自己手动实现手指拖动停止后的惯性滑动位移。

解决方案二:自定义 UICollectionViewFlowLayout 子类,重写 - (CGPoint)targetContentOffsetForProposedContentOffset:(CGPoint)offset withScrollingVelocity:(CGPoint)velocity 方法,重新计算 targetContentOffset。

参考:

@ShannonChenCHN
Copy link
Owner Author

ShannonChenCHN commented May 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant