swift 阴影 边框 圆角

2023-04-10  本文已影响0人  tech_go

设置阴影的颜色、透明度、偏移量和半径。例如:

myView.layer.shadowColor = UIColor.black.cgColor
myView.layer.shadowOpacity = 0.5
myView.layer.shadowOffset = CGSize(width: 0, height: 3)
myView.layer.shadowRadius = 5

设置View的背景色和圆角半径。例如:

myView.backgroundColor = UIColor.white
myView.layer.cornerRadius = 10

设置边框的颜色、宽度和圆角半径。例如:

myView.layer.borderColor = UIColor.blue.cgColor
myView.layer.borderWidth = 2
myView.layer.cornerRadius = 10
上一篇 下一篇

猜你喜欢

热点阅读