我正在使用 HTTPS 鏈接將影像手動存盤在 Firebase 中,但是如何在前端將其顯示為影像,而不僅僅是字串格式的鏈接?
到目前為止,這是我的代碼:
Vstack{
Image(skinproduct.image)
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 120, height: 120)
}
uj5u.com熱心網友回復:
您需要通過轉到 file -> add Packages : 并搜索名為 SDWebImageSwiftUI 的包來匯入包。
然后,您需要將包匯入視圖頂部,如下所示:
import SDWebImageSwiftUI
并在前端呼叫它:
WebImage(url: URL(string: skinproduct.image))
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/521527.html
