Closed SingletonH closed 4 years ago
`collectionView.deselectItem(at: indexPath, animated: false) let browser = JXPhotoBrowser()
browser.numberOfItems = { self.dataSource.count } browser.reloadCellAtIndex = { context in let url = URL(string: self.dataSource[indexPath.row]) let browserCell = context.cell as? JXPhotoBrowserImageCell // 用Kingfisher加载 browserCell?.imageView.kf.setImage(with: url, placeholder: UIImage(named: "icon_placeholder_1"), options: [], progressBlock: nil, completionHandler: { (image, error, cashType, url) in browserCell?.setNeedsLayout() }) } browser.transitionAnimator = JXPhotoBrowserZoomAnimator(previousView: { index -> UIView? in let path = IndexPath(item: index, section: indexPath.section) let cell = collectionView.cellForItem(at: path) as? MAImageBrowserCollectionViewCell return cell?.imageView }) browser.pageIndex = indexPath.item browser.show()`
感谢反馈,我查下。楼主可以在我demo中复现出这个问题吗?
demo没有这个问题,我上面那段代码貌似也没啥问题
这么奇怪
let url = URL(string: self.dataSource[indexPath.row]) 数据源这里写错了,我的问题
`collectionView.deselectItem(at: indexPath, animated: false) let browser = JXPhotoBrowser()