Answers for "swiftui rectangle color"

0

shapes in swiftui

struct ContentView: View {
    var body: some View {
        ZStack {
            Rectangle()
                .fill(Color.black)
                .frame(width: 200, height: 200)

            RoundedRectangle(cornerRadius: 25, style: .continuous)
                .fill(Color.red)
                .frame(width: 200, height: 200)

            Capsule()
                .fill(Color.green)
                .frame(width: 100, height: 50)

            Ellipse()
                .fill(Color.blue)
                .frame(width: 100, height: 50)

            Circle()
                .fill(Color.white)
                .frame(width: 100, height: 50)
        }
    }
}
Posted by: Guest on July-23-2020
0

swiftui rectangle color

Rectangle()
    .fill(Color.red)
    .frame(width: 200, height: 200)
Posted by: Guest on June-06-2021

Browse Popular Code Answers by Language