[英]Swift: How to display a CollectionView inside a TableViewCell Programmatically
[英]Load webviews and take snapshots programmatically to display in collectionView
我目前正在加载WebViews
的collectionView
,可以,但是效果WebViews
,例如广告经常遮盖了webview
的内容。 我想做的是以编程方式加载webview
并对其进行快照,然后使用与WebViews
本身相对的图像重新加载collectionView
?
override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: reuseIdentifier, for: indexPath) as! ResultsCollectionViewCell
if let url = Urls?[indexPath.row] {
self.activityIN.stopAnimating()
self.progressLabel.removeFromSuperview()
cell.webView.loadRequest(URLRequest(url: url))
}
return cell
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.