📦ShadowStyle
(struct)
SwiftUI ⟩ view ⟩ drawing ⟩ shadow ⟩ ShadowStyle
ShapeStyle 有兩個 shadow()❗️
ShapeStyle.shadow(): type method:爲 current style 加陰影。style.shadow(): instance method:爲ShapeStyleinstance 加陰影。
// Color 遵循 ShapeStyle, 因此 .blue 可呼叫 .shadow() (instance method)
// shape.fill(shapeStyle_withShadow)
Circle()
// 藍色+陰影 ╭─⭐️ShadowStyle─╮
.fill(.blue.shadow(.drop(radius: 10)))type method .shadow() :爲 current style 加陰影
instance method .shadow() :爲 ShapeStyle 的 instance 加陰影
SwiftUI ⟩ Drawing and graphics ⟩ ShadowStyle ⟩
.inner(color:radius:x:y:) :custom inner shadow style.
StackOverflow ⟩ an instance calls a static method?
Last updated
Was this helpful?