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,61 +140,68 @@ struct CharacterDetailGalleryView: View {
@ViewBuilder
private func galleryImageView(item: CharacterImageListItemResponse, index: Int) -> some View {
ZStack {
//
AsyncImage(url: URL(string: item.imageUrl)) { image in
image
.resizable()
.aspectRatio(contentMode: .fill)
} placeholder: {
Rectangle()
.fill(Color.gray.opacity(0.3))
}
.frame(width: 132, height: 165)
.clipped()
.cornerRadius(0)
GeometryReader { geo in
let width = geo.size.width
let height = width * 5 / 4
//
if !item.isOwned {
//
Rectangle()
.fill(Color.black.opacity(0.2))
.frame(width: 132, height: 165)
//
VStack(spacing: 8) {
//
Image("ic_new_lock")
ZStack {
//
AsyncImage(url: URL(string: item.imageUrl)) { image in
image
.resizable()
.scaledToFit()
.frame(width: 24)
.scaledToFill()
.frame(width: width, height: height)
.clipped()
} placeholder: {
Rectangle()
.fill(Color.gray.opacity(0.3))
}
//
if !item.isOwned {
//
Rectangle()
.fill(Color.black.opacity(0.2))
//
HStack(spacing: 4) {
Image("ic_can")
//
VStack(spacing: 8) {
//
Image("ic_new_lock")
.resizable()
.scaledToFit()
.frame(width: 16)
.frame(width: 24)
Text("\(item.imagePriceCan)")
.font(.custom(Font.preBold.rawValue, size: 16))
.foregroundColor(Color(hex: "#263238"))
}
.padding(.horizontal, 12)
.padding(.vertical, 6)
.background(Color(hex: "#B5E7FA"))
.cornerRadius(30)
.overlay {
RoundedRectangle(cornerRadius: 30)
.strokeBorder(lineWidth: 1)
.foregroundColor(.button)
//
HStack(spacing: 4) {
Image("ic_can")
.resizable()
.scaledToFit()
.frame(width: 16)
Text("\(item.imagePriceCan)")
.font(.custom(Font.preBold.rawValue, size: 16))
.foregroundColor(Color(hex: "#263238"))
}
.padding(.horizontal, 12)
.padding(.vertical, 6)
.background(Color(hex: "#B5E7FA"))
.cornerRadius(30)
.overlay {
RoundedRectangle(cornerRadius: 30)
.strokeBorder(lineWidth: 1)
.foregroundColor(.button)
}
}
}
}
.frame(width: width, height: height)
.clipped()
.contentShape(Rectangle())
.onTapGesture {
viewModel.onImageTapped(item, index: index)
}
}
.onTapGesture {
viewModel.onImageTapped(item, index: index)
}
.aspectRatio(4/5, contentMode: .fit)
}
}