0

I wonder if someone might be able to point me in the right direction with regards to getting two Text items to sit next to each other without leaving the white gap (see image below). There are lots of spacings, borders and alignments, but after playing around for 30mins I don't seem to be any closer.

enter image description here

The code I am using is as follows:

struct TestView: View {
    var body: some View {
        VStack {
            HStack() {
                Text("SHOT").background(Color.red)
                Text("GUN").background(Color.blue)
            }
            Text("SHOTGUN").background(Color.green)
        }
    }
}
fuzzygoat
  • 26,573
  • 48
  • 165
  • 294

1 Answers1

1

try

struct ContentView: View {
    var body: some View {
        VStack {
            HStack(spacing: 0) {
                Text("SHOT").background(Color.red)
                Text("GUN").background(Color.blue)
            }
            Text("SHOTGUN").background(Color.green)
        }
    }
}
q8yas
  • 897
  • 8
  • 10