我在单元 View 中插入了一个带有图像的 UIView,如下图所示。
我尝试过:
DispatchQueue.main.async {
self.hideProfileDescriptionView.addSubview(self.hidedescriptionLogo)
self.hideProfileDescriptionView.bringSubview(toFront:
self.hidedescriptionLogo)
self.cellDescriptionView.addSubview(self.hideProfileDescriptionView)
}
第一次调用UIVIewController时,图像不显示,但第二次调用UIViewController时,图像出现。 我该如何解决这个问题。
谢谢
最佳答案
在第一种情况下,图像未完全加载,第二次下载已完成。如果您不想等待此安装,您可以使用 KingFisher 存储库 https://github.com/onevcat/Kingfisher 。
强烈推荐此存储库。另外,通过此存储库,您可以将 laoder 放入 UIImageView 中。
关于 swift 4 : Image inside UIView only display after second UIViewController call,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52770778/