Thursday, March 7, 2024
HomeiOS Developmentios - Scrollview freeze web page - Invalid body dimension

ios – Scrollview freeze web page – Invalid body dimension


I’ve two completely different views one topCardView and second is BottomView.
I set scrollview and GeometryReader and set each views accordingly.

Drawback I’m dealing with is on scrolling the web page freeze and getting an error of Invalid body dimension (unfavourable or non-finite)

Code:

ScrollView(.vertical, showsIndicators: false, content material: {
   GeometryReader { reader in
                topCardView
                    .offset(y: -reader.body(in: .world).minY)
                    .body(width: UIScreen.most important.bounds.width, top: reader.body(in: .world).minY + 500)
            }
            .body(top: 500)
            
            VStack(spacing: 40) {
                BottomView
            }
            .padding(.vertical, 32)
            .padding(.horizontal, 16)
            .background(
                Coloration(pink: 232/255, inexperienced: 230/255, blue: 225/255)
                    .cornerRadius(40)
            )
            .offset(y: -25)
        })

Photos:

log

warning

Scroll



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments