Skip to content

.aspectRatio doesn't apply to AsyncImage placeholder #320

@dfabulich

Description

@dfabulich

Add this playground to the ImagePlayground:

HStack {
    Text("Failed URL\n.aspectRatio(3/4)")
    Spacer()
    AsyncImage(url: URL(string: "file:///does_not_exist.png")!)
        .aspectRatio(3.0/4.0, contentMode: .fit)
        .border(Color.blue)
}

Expected: You should see a 3x4 placeholder rectangle

Image

Actual: The placeholder doesn't appear (it renders 0x0)

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions