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

getCurrentIndex 方法 在阿语环境下就 无法实现了 #36

Open
blockshark opened this issue Aug 13, 2021 · 0 comments
Open

getCurrentIndex 方法 在阿语环境下就 无法实现了 #36

blockshark opened this issue Aug 13, 2021 · 0 comments

Comments

@blockshark
Copy link

正确的写法应该是这样
private func getCurrentIndex() -> Int {
let point = self.convert(collectionView.center, to: self.collectionView)
let indexPath = self.collectionView.indexPathForItem(at: point)
return indexPath?.item ?? 0
}

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

No branches or pull requests

1 participant