How do i set full height on a component in a scroll view?

If you want it to be full screen and ignoring safe area you can set the UserCard‘s height to screen height like this:

   Text("long text")
.frame(height: UIScreen.main.bounds.height)

And if you want it to respect safe area you could use a GeometryReader:

GeometryReader { geometry in
    ScrollView {
            .frame(height: geometry.size.height)
            .frame(height: geometry.size.height)
            .frame(height: geometry.size.height)

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top