Why does a LazyHStack behaves differently than an HStack regarding the height? (same for the VStack).
import SwiftUI
struct LazyTestView: View {
var body: some View {
LazyHStack {
ForEach(1...10, id: \.self) { int in
Text("\(int)")
}
}
}
}
struct LazyTestView_Previews: PreviewProvider {
static var previews: some View {
LazyTestView()
.previewLayout(.sizeThatFits)
}
}
Whereas with an HStack:
import SwiftUI
struct LazyTestView: View {
var body: some View {
HStack {
ForEach(1...10, id: \.self) { int in
Text("\(int)")
}
}
}
}
One solution is to add .fixedSize()
for the LazyHStack...
PS: Xcode Version 12.5 beta (12E5220o)