0

enter image description hereSwiftUI Horizontal ScrollView item becomes invisible when scrolled in iOS 14.3 but works fine in 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)

                }
            }}
Adeyemi Seun
  • 111
  • 9

1 Answers1

0

the culprit was .cornerRadius(20, corners: [.topLeft, .topRight]) changed it to .cornerRadius(20) and it works fine

Adeyemi Seun
  • 111
  • 9
  • https://stackoverflow.com/questions/64259513/swiftui-issue-on-ios-14-with-scrollview-hstack-content-being-cut-off/64571117 – Adeyemi Seun Feb 21 '21 at 17:27