๐Ÿ”นview.foregroundStyle()

SwiftUI โŸฉ view โŸฉ drawing โŸฉ foreground โŸฉ style โŸฉ .foregroundStyle()

่จญๅฎšๅ‰ๆ™ฏๅ…ƒ็ด ็š„ ShapeStyleใ€‚

If you want to fill a single Shape instance, use fill(style:) instead. ๐Ÿ‘‰ Apple โŸฉ view.foregroundStyle()

HStack {
    Image(systemName: "triangle.fill")
    Text("Hello, world!")
    RoundedRectangle(cornerRadius: 5)
        .frame(width: 40, height: 20)
}
// โญ๏ธ view.foregroundStyle(shapeStyle)
.foregroundStyle(.teal)

Last updated