gpt4 book ai didi

ios - UIImageView 上的阴影问题

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

<分区>

我正在尝试在 UICollectionViewCell 中设置 cornerRadiusUIImageVIew 的阴影。问题是我设置了 clipToBounds = true 并停止了阴影和 cornerRadius

我想要图像的 cornerRadius、clipToBounds 和阴影。不知道我在这里做错了什么。

class PostPhotoCell: UICollectionViewCell {

@IBOutlet weak var selectedImage: UIImageView!
@IBOutlet weak var deleteButton: UIButton!


override func awakeFromNib()
{
super.awakeFromNib()

selectedImage.layer.cornerRadius = 5.0
selectedImage.contentMode = .scaleAspectFill
//applying overall shadow to image
selectedImage.layer.shadowColor = UIColor(white: 0.0, alpha: 0.5).cgColor
selectedImage.layer.shadowOffset = CGSize(width: 0, height: 0)
selectedImage.layer.shadowOpacity = 1.0
selectedImage.layer.shadowRadius = 6.0
selectedImage.clipsToBounds = true
}
}

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