fix(character-detail, gallery): 이미지 사이즈 수정

This commit is contained in:
Yu Sung
2025-09-04 16:51:13 +09:00
parent ee67e1eab7
commit ac5563eaa7

View File

@@ -140,26 +140,28 @@ struct CharacterDetailGalleryView: View {
@ViewBuilder
private func galleryImageView(item: CharacterImageListItemResponse, index: Int) -> some View {
GeometryReader { geo in
let width = geo.size.width
let height = width * 5 / 4
ZStack {
//
AsyncImage(url: URL(string: item.imageUrl)) { image in
image
.resizable()
.aspectRatio(contentMode: .fill)
.scaledToFill()
.frame(width: width, height: height)
.clipped()
} placeholder: {
Rectangle()
.fill(Color.gray.opacity(0.3))
}
.frame(width: 132, height: 165)
.clipped()
.cornerRadius(0)
//
if !item.isOwned {
//
Rectangle()
.fill(Color.black.opacity(0.2))
.frame(width: 132, height: 165)
//
VStack(spacing: 8) {
@@ -192,10 +194,15 @@ struct CharacterDetailGalleryView: View {
}
}
}
.frame(width: width, height: height)
.clipped()
.contentShape(Rectangle())
.onTapGesture {
viewModel.onImageTapped(item, index: index)
}
}
.aspectRatio(4/5, contentMode: .fit)
}
}
#Preview {