I think you want scaledToFill()
on both the VStack
and the HStack
:
HStack(alignment: .center, spacing: 0) { ForEach(0...6, id: \.self) { _ in VStack(alignment: .center) { Text("T") } .frame(maxWidth: .infinity, maxHeight: .infinity) .background(Color(UIColor.white.withAlphaComponent(0.1))) .cornerRadius(5) .padding(2) .scaledToFill() }}.frame(maxWidth: .infinity, idealHeight: 70).scaledToFill()
And where the .frame()
is set does make a difference as pointed out by @timbre