title: Overlay text on Image SwiftUI and WidgetKit
body: <p>I'm currently creating a widget for my new iOS 14 app and I encountered a weird problem when I'm trying to add and Overlay with Text on top of my Image. The overlay is correctly working on a blank SwiftUI project but it's not working on the Widget.</p>
  <p>Below you can find the code that I'm using. KFImage is from KingFisherSwiftUI, but if you want to test it, you can just add a static Image from the Asset or from the System.</p>
  <p>Thanks!</p>
  <pre><code>  struct NewItems: View {
      var body: some View {
          KFImage(URL(string: &quot;https://img.freepik.com/free-vector/triangular-dark-polygonal-background_23-2148261453.jpg?size=626&amp;ext=jpg&quot;)! )
              .resizable()
              //.frame(width: 200, height: 200, alignment: .center)
              .overlay(TextView(), alignment: .bottomTrailing)
              .cornerRadius(20)
      }
  }
  
  struct TextView: View {
      var body: some View {
          ZStack {
              Text(&quot;Hello World Beautiful wallpaper&quot;)
                  .foregroundColor(.white)
                  .shadow(color: .black, radius: 1, x: 1.0, y: 1.0)
                  .padding(6)
                  .opacity(0.8)
          }
          .background(Color.black)
          .cornerRadius(10)
          .padding(3)
      }
  }
  </code></pre>
  <p>[EDIT]</p>
  <p>Below the result of the code. Looks like the image is on top of the text, even though it supposed to be in overlay.</p>
  <p><a href="https://i.stack.imgur.com/KiBR2.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KiBR2.jpg" alt="enter image description here" /></a> <a href="https://i.stack.imgur.com/fsPHm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fsPHm.png" alt="enter image description here" /></a></p>