fix(android): resolve local asset image resource loading using asyncimage and bundle url
This commit is contained in:
@@ -96,12 +96,18 @@ struct FeaturedStoreCard: View {
|
||||
private var storeIconPlaceholder: some View {
|
||||
ZStack {
|
||||
#if os(Android)
|
||||
Image("placeholder-product", bundle: .module)
|
||||
.resizable()
|
||||
.scaledToFill()
|
||||
.opacity(0.7)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.clipped()
|
||||
AsyncImage(url: Bundle.module.url(forResource: "placeholder-product", withExtension: "png")) { phase in
|
||||
if let image = phase.image {
|
||||
image
|
||||
.resizable()
|
||||
} else {
|
||||
Color.clear
|
||||
}
|
||||
}
|
||||
.scaledToFill()
|
||||
.opacity(0.7)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.clipped()
|
||||
#else
|
||||
Image("placeholder-product")
|
||||
.resizable()
|
||||
|
||||
Reference in New Issue
Block a user