Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我这样做view.layer.shadowOffset = CGSize(width: -1, height: 1),数字 -1 代表宽度,1 代表高度是什么意思?从 CGSize 中确定的阴影是如何传递的?我找到了文档,但它不是很有用
view.layer.shadowOffset = CGSize(width: -1, height: 1)
考虑width和height作为x和y。你应该知道 iOS 坐标从左上角开始。 CGSize(width: -1, height: 1)表示阴影将在 x 轴上向左移动 1 点,在 y 轴上向上移动 1 点。
width
height
x
y
CGSize(width: -1, height: 1)