fix(character-detail) 캐릭터 상세

- 화면이 좌우로 길어지면서 잘리던 버그 수정
This commit is contained in:
Yu Sung
2025-09-02 04:32:45 +09:00
parent 7b3bb79e2c
commit 833fd0f1b0
2 changed files with 10 additions and 11 deletions

View File

@@ -6,6 +6,7 @@
//
import SwiftUI
import Kingfisher
struct CharacterDetailView: View {
@@ -167,16 +168,10 @@ extension CharacterDetailView {
extension CharacterDetailView {
private var characterImageSection: some View {
//
AsyncImage(url: URL(string: viewModel.characterDetail?.imageUrl ?? "https://picsum.photos/400")) { image in
image
KFImage(URL(string: viewModel.characterDetail?.imageUrl ?? "https://picsum.photos/400"))
.resizable()
.aspectRatio(contentMode: .fill)
} placeholder: {
Rectangle()
.fill(Color.gray)
}
.frame(maxWidth: .infinity)
.frame(height: screenSize().width)
.scaledToFill()
.frame(width: screenSize().width, height: screenSize().width, alignment: .top)
.clipped()
}
}
@@ -190,6 +185,8 @@ extension CharacterDetailView {
Text(viewModel.characterDetail?.name ?? "")
.font(.custom(Font.preBold.rawValue, size: 26))
.foregroundColor(.white)
.lineLimit(1)
.truncationMode(.tail)
if let characterType = viewModel.characterDetail?.characterType {
HStack(spacing: 8) {

View File

@@ -28,6 +28,8 @@ struct DetailNavigationBar: View {
Text(title)
.font(.custom(Font.preBold.rawValue, size: 18.3))
.foregroundColor(.grayee)
.lineLimit(1)
.truncationMode(.tail)
}
Spacer()