🔸shadow
╱🚧 under construction -> current style
SwiftUI ⟩ view ⟩ drawing ⟩ shadow
加陰影時,可用 .blendMode() 來避免陰影擋住前景。
view.shadow():爲 view 加陰影
ShadowStyle:陰影樣式
type method .shadow() :爲 current style 加陰影
instance method .shadow() :爲 ShapeStyle 的 instance 加陰影
// ⭐️ shape.fill(shapeStyle_withShadow)
Circle()
// 藍色+陰影 ╭──ShadowStyle───╮
.fill(.blue.shadow(.drop(radius: 10))) // .blue calls its instance method .shadow()blend mode:畫內陰影時,有時要用
.blendMode()填充色才不會蓋著前景。如果要幫整個 container view 加陰影,需用到
.compositingGroup()。
Swatch:色卡有內陰影設計
SwiftUI ⟩
.shadow(_:) (type method)
.shadow(_:) (instance method)
Drawing and graphics ⟩ ShadowStyle ⟩
.inner(color:radius:x:y:) :custom inner shadow style.
Last updated
Was this helpful?