Update the readme about the placeholder ViewBuilder on AnimatedImage

This commit is contained in:
DreamPiggy 2020-04-05 13:50:35 +08:00
parent cd187c81b0
commit f2f51de40e
1 changed files with 4 additions and 0 deletions

View File

@ -163,6 +163,10 @@ var body: some View {
}
.resizable() // Resizable like SwiftUI.Image, you must use this modifier or the view will use the image bitmap size
.placeholder(UIImage(systemName: "photo")) // Placeholder Image
// Supports ViewBuilder as well
.placeholder {
Circle().foregroundColor(.gray)
}
.indicator(SDWebImageActivityIndicator.medium) // Activity Indicator
.transition(.fade) // Fade Transition
.scaledToFit() // Attention to call it on AnimatedImage, but not `some View` after View Modifier (Swift Protocol Extension method is static dispatched)