【发布时间】:2018-11-30 17:50:44
【问题描述】:
我安装了这个包https://github.com/hyperoslo/Lightbox,但是我不知道如何通过我的collectionView的索引来显示想要的图片,而不是第一个
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
let controller = LightboxController(images: imagess)
controller.pageDelegate = self as? LightboxControllerPageDelegate
controller.dismissalDelegate = self as? LightboxControllerDismissalDelegate
controller.dynamicBackground = true
present(controller, animated: true, completion: nil)
}
在这种情况下,我可以更换图片,但总是出现第一张
我似乎已经阅读了所有内容,但我没有找到这个重要的细节。
如果我这样做:
let controller = LightboxController(images: [imagess[indexPath.row]])
我只能查看一张具有所需索引的图片,但无法更改图库中的图片
请帮忙:-)
【问题讨论】:
-
你能显示'imagess'数组吗?