SwiftUI Horizontal ScrollView 项目在 iOS 14.3 中滚动时变得不可见,但在 iOS 13 中工作正常
GeometryReader { geometry in
ZStack (alignment: .center) {
Color(UIColor(hexString: "#F2F2F7"))
.edgesIgnoringSafeArea(.all)
VStack(alignment: .center){
ScrollView (.horizontal, showsIndicators: false) {
LazyHStack {
//contents
ForEach(0..<200)
{ index in
Text(String(index))
}
}}
.frame(maxWidth: .infinity) // << here !!
.frame(height: 100)
}
}}