๐ธforeground
โฑ๐ง under construction -> current context
SwiftUI โฉ view โฉ drawing โฉ foreground
foreground element๏ผๅๆฏๅ ็ด
view.foregroundStyle()๏ผ่จญๅฎๅๆฏๅ ็ด ็ ShapeStyleใ
HStack {
Image(systemName: "triangle.fill")
Text("Hello, world!")
RoundedRectangle(cornerRadius: 5)
.frame(width: 40, height: 20)
}
// โญ๏ธ view.foregroundStyle(shapeStyle)
.foregroundStyle(.teal)SwiftUI โฉ
ShapeStyle โฉ foreground (static)๏ผforeground style in the current context.
View โฉ .foregroundStyle(_:) ๏ผset a new foreground style for a given view and its child views.
Last updated
Was this helpful?