1

Here's the code

import SwiftUI

struct ExampleView: View {
    let columns = [
        GridItem(.flexible(), alignment: .leading),
        GridItem(.flexible(), alignment: .center),
        GridItem(.flexible(), alignment: .center),
        GridItem(.flexible(), alignment: .trailing)
    ]
    
    var body: some View {
        ScrollView(.vertical) {
            LazyVGrid(columns: columns, spacing: 20) {
                ForEach(fetchedPhotos, id: \.self) { photo in
                    VStack {
                        AsyncImage(url: URL(string: photo.imageURL)) { image in
                            image
                                .resizable()
                                .scaledToFit()
                                .aspectRatio(contentMode: .fill)
                        } placeholder: {
                            ProgressView()
                        }
                    }
                }
            }
        }
    }
}

I don't know what causes this, I scroll down and when I scroll back it shows placeholder ProgressView again. Hope you can help me figure it out

leo
  • 82
  • 1
  • 6

0 Answers0