KFImage를 이용하여 불러오는 이미지 다운샘플링
This commit is contained in:
@@ -32,6 +32,13 @@ struct SectionRecommendLiveView: View {
|
||||
let item = items[index]
|
||||
if let url = item.imageUrl.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) {
|
||||
KFImage(URL(string: url))
|
||||
.cancelOnDisappear(true)
|
||||
.downsampling(
|
||||
size: CGSize(
|
||||
width: screenSize().width - 26.7,
|
||||
height: (screenSize().width - 26.7) * 0.53
|
||||
)
|
||||
)
|
||||
.resizable()
|
||||
.scaledToFill()
|
||||
.frame(
|
||||
@@ -44,6 +51,13 @@ struct SectionRecommendLiveView: View {
|
||||
.cornerRadius(4.7)
|
||||
} else {
|
||||
KFImage(URL(string: item.imageUrl))
|
||||
.cancelOnDisappear(true)
|
||||
.downsampling(
|
||||
size: CGSize(
|
||||
width: screenSize().width - 26.7,
|
||||
height: (screenSize().width - 26.7) * 0.53
|
||||
)
|
||||
)
|
||||
.resizable()
|
||||
.scaledToFill()
|
||||
.frame(
|
||||
|
Reference in New Issue
Block a user