gpt4 book ai didi

Swift 3 xcode storyboard,给 UIView 添加 box-shadow,就像 CSS 样式的 box-shadow

转载 作者:可可西里 更新时间:2023-10-31 23:52:45 26 4
gpt4 key购买 nike

如您所见,我想在单元格中的每个 UIView 的边缘周围添加一个阴影,因为灰色的白色很难看清它的边框。

enter image description here

最佳答案

设置 View 的阴影属性以添加阴影。

swift 3

YourView.layer.shadowOpacity = 0.7
YourView.layer.shadowOffset = CGSize(width: 3, height: 3)
YourView.layer.shadowRadius = 15.0
YourView.layer.shadowColor = UIColor.darkGray.cgColor

注意:用您想要阴影的 View 替换 YourView。

关于Swift 3 xcode storyboard,给 UIView 添加 box-shadow,就像 CSS 样式的 box-shadow,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42244040/

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