HomeiOS DevelopmentWhy can't scroll the photographs?

Why can’t scroll the photographs? [closed]


I create two class from video lesson:

import SwiftUI

struct ScrollImage: View {
    let picture: ImageResource

    var physique: some View {
        Picture(picture)
            .resizable()
            .scaledToFit()
            .border(Shade.purple, width: 1)
            .clipShape(RoundedRectangle(cornerRadius: 20, type: .steady))
            .scrollTransition(.interactive, axis: .vertical) { content material, section in
                content material
                    .scaleEffect(section.isIdentity ? 1 : 0.85)
                    .opacity(section.isIdentity ? 1 : 0.6)
            }
    }
}

#Preview {
    ScrollImage(picture: .automotive)
}
import SwiftUI

struct Scrolling: View {
    var physique: some View {
        ScrollView {
            LazyVStack(spacing: 20) {
                ScrollImage(picture: .automotive)
                ScrollImage(picture: ._111)
                ScrollImage(picture: .automotive)
                ScrollImage(picture: ._111)
                ScrollImage(picture: .automotive)
                ScrollImage(picture: ._111)
                ScrollImage(picture: .automotive)
                ScrollImage(picture: ._111)
            }
            .padding()
        }
    }
}

#Preview {
    Scrolling()
}

Preview:

Why can’t scroll the photographs? [closed]

Why cannot I scroll by means of these photos?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments