【发布时间】:2016-09-30 18:40:41
【问题描述】:
我编写了以下代码来下载并在 tableView 的单元格中显示图像。但是,阴影根本没有出现,我不知道出了什么问题。
cell.societyImage.setIndicatorStyle(UIActivityIndicatorViewStyle.White)
cell.societyImage.setShowActivityIndicatorView(true)
cell.societyImage.sd_setImageWithURL(NSURL(string: pictureURLs[objectIds[indexPath.row]]!),completed: { (image, error, cache, url) in
cell.societyImage.layer.shadowColor = UIColor(white: 0.7, alpha: 0.7).CGColor
cell.societyImage.layer.shadowOffset = CGSizeMake(3, 3)
cell.societyImage.layer.shadowOpacity = 0.4
cell.societyImage.layer.masksToBounds = true
})
非常感谢任何帮助!
【问题讨论】:
-
将 shadowradius 和 clipsToBound 属性添加到您的代码中,将解决您的问题。
标签: ios swift uiimageview shadow