๐ฐForeground
// set background material
view
// material layer
// material works best when there is a background layer
.background(.ultraThinMaterial)
// background layer
.background(Image("Blob 1")) // image from assets
// a material with a particular shape
view.background(.regularMaterial, in: RoundedRectangle(cornerRadius: 8))
// foreground style (text gradient)
text.foregroundStyle(.linearGradient(
colors : [.primary, .primary.opacity(0.5)],
startPoint: .topLeading,
endPoint : .bottomTrailing
))
SwiftUI โฉ Drawing and Animation โฉ ShapeStyle โฉ Material
View โฉ
.background(_:in:fillStyle:) - background with a particular shape
Last updated