title: How can I fit a shape in swift ui to accommodate the length and width of a text view
body: <p><a href="https://i.stack.imgur.com/oS3QY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oS3QY.png" alt="This is what I want to happen in my code and I want the rectangle to scale to whatever font size."></a></p>
  
  <pre><code>ZStack{
                          RoundedRectangle(cornerRadius: 8).foregroundColor(.red).scaledToFit()//.frame(width: 200, height: 25)
                          HStack{
                              Image(systemName: "tag.fill").foregroundColor(.white)
                              Text("Tickets Not Available").font(.headline).foregroundColor(.white).fixedSize(horizontal: true, vertical: false)
                          }
                      }.scaledToFit()
  </code></pre>
  
  <blockquote>
    <p>As you can see my views are placed in a zstack so that the rounded rectangle can be the background of the text view. I've tried so many different things like where to put the .scaledtofit and it just gives me wack results each time.</p>
  </blockquote>