I'm currently developing an application using SwiftUI.
When I use 2 HStacks which have Images in a Vstack, the VStack makes a space between 2 HStacks like the photo below:
Then How can I remove that space?
I am confused about this problem because if I exchange Images in HStacks to Texts, that space disappears...
How can I remove that space when I use Images in HStacks?
Here is the code:
ContentView.swift
import SwiftUI
struct ContentView: View {
var body: some View {
VStack{
HStack{
Image(systemName: "circle")
// Text("test")
} .frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color.yellow)
HStack{
Image(systemName: "circle")
// Text("test")
} .frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color.blue)
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Xcode: Version 11.7
Swift: Swift 5