Please see image.
I want the text "one case per million to extend". but in this scenario, it seems that the image overlay is occupying space inside the the view where the text are located
Same as "One Death Per People". I think the first line should be "One Death Per" and maybe because the image is big that it somehow is occupying its area? (But i placed the image in overlay so it should be rendered no top)
I think the word "Per" should still in in the first line.
Any idea what could be the problem?
This is my code
struct Stat: View {
var body: some View {
VStack {
Text("One Case Per People")
.frame(maxWidth: .infinity, alignment: .leading)
.font(.system(size: 19))
Text("2")
.frame(maxWidth: .infinity, alignment: .leading)
.font(.system(size: 15))
Spacer()
}
.padding(8)
.frame(minHeight: 100)
.cornerRadius(8)
.background(Color.gray)
.overlay(
Image(systemName: "person.3.fill")
.resizable()
.frame(width: 60, height: 60, alignment: .trailing)
.padding(8),
alignment: .bottomTrailing
)
}
}
I used a grid to display them
ScrollView {
LazyVGrid(columns: [GridItem(.flexible()), GridItem(.flexible())]) {
Stat()
Stat()
Stat()
Stat()
}
}
}
Thoughts?