🔸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?