V8tr / AsyncImage

Asynchronous Image Loading from URL in SwiftUI
https://www.vadimbulavin.com/
The Unlicense
275 stars 36 forks source link

Load black images and first load not show images #4

Closed luisrmz92 closed 4 years ago

luisrmz92 commented 4 years ago

load images black image

first load image

second load image

ghost commented 4 years ago

The Author should consider put the following modifier in method private var image: some View: .renderingMode(.original) The whole method would then this: private var image: some View { Group { if loader.image != nil { Image(uiImage: loader.image!) .resizable().renderingMode(.original) } else { placeholder } } }

This solved the black image phenomenon when using AsyncImage() i.e. in a SwiftUI-Button-View

filimo commented 4 years ago

@NeoLeonGithub Thanks for solution .renderingMode(.original) helps me without .resizable() The problems came when I started using AsyncImage into Button inside of List on iOS 13. iOS 14 works fine without it.

V8tr commented 4 years ago

@NeoLeonGithub thanks for suggesting the solution! I am closing the issue since the problem has been addressed.