gpt4 book ai didi

swift - 快速向左/向右滚动时进度 View 丢失

转载 作者:行者123 更新时间:2023-11-28 16:15:16 24 4
gpt4 key购买 nike

我有水平位置的 Collection View 。用户可以下载文件,它显示进度 View ,下载完成后进度 View 完全充满蓝色但是如果我滚动 Collection View 直到已经下载的文件不可见,进度 View 丢失

这是我的代码

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
self.navigationController?.navigationBarHidden = true
}
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(true)
self.navigationController?.navigationBarHidden = true
}
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {

let cell: magazineCell = self.collectionView.dequeueReusableCellWithReuseIdentifier("Cell", forIndexPath: indexPath) as! magazineCell

cell.progressDownload.hidden = true //the progress bar
cell.progressLabel.hidden = true //download percent
cell.progressDownload.setProgress(0, animated: true)
}

func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
cell.progressDownload.hidden = false
cell.progressLabel.hidden = false
}

最佳答案

当重新创建滚动单元格再次隐藏你的进度条时,你需要设法检查是否已经下载,然后设置进度条显示/隐藏和下载进度。

关于swift - 快速向左/向右滚动时进度 View 丢失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39161537/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com