0

在此处输入图像描述SwiftUI Horizo​​ntal 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)

                }
            }}
4

1 回答 1

0

罪魁祸首是 .cornerRadius(20, corners: [.topLeft, .topRight]) 将其更改为 .cornerRadius(20) 并且工作正常

于 2021-02-02T19:13:34.357 回答