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