0
struct Item: Identifiable {
    let id: String
    let url = URL(string: "https://styles.redditmedia.com/t5_j6lc8/styles/communityIcon_9uopq0bazux01.jpg")!
}

struct Content: View {

    let model: [Item] = {
        var model = [Item]()
        for i in 0 ..< 100 {
            model.append(.init(id: String(i)))
        }
        return model
    }()

    var body: some View {
        List(model) { item in
            Row(item: item)
        }
    }

}

struct Row: View {

    let item: Item

    var body: some View {
        AsyncImage(url: item.url)
    }

}

Running code above with Xcode 14.1 on iOS 16.1 simulator, AsyncImage sometimes doesn’t properly show downloaded image but grey rectangle instead when scrolling in list. Is this bug or am I missing something? Thanks

2 Answers 2

1

.fixedSize() fixed the problem me

Sign up to request clarification or add additional context in comments.

Comments

0

My solution was to use VStack in ScrollView instead of List. It looks like it's working and it doesn't have any other drawbacks.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.