크리에이터 커뮤니티

- 텍스트뷰의 width를 screenSize().width - 42로 설정하여 아이템에 horizontal padding이 적용되지 않던 버그 수정
This commit is contained in:
Yu Sung 2024-05-24 22:28:35 +09:00
parent 3ae5ea776c
commit e7cbabb285
2 changed files with 4 additions and 4 deletions

View File

@ -71,19 +71,19 @@ struct CreatorCommunityAllItemView: View {
if item.price <= 0 || item.existOrdered { if item.price <= 0 || item.existOrdered {
DetectableTextView(text: item.content, textSize: 13.3, font: Font.medium.rawValue) DetectableTextView(text: item.content, textSize: 13.3, font: Font.medium.rawValue)
.frame( .frame(
width: screenSize().width - 16, width: screenSize().width - 42,
height: textHeight height: textHeight
) )
.onAppear { .onAppear {
self.textHeight = self.estimatedHeight( self.textHeight = self.estimatedHeight(
for: item.content, for: item.content,
width: screenSize().width - 16 width: screenSize().width - 42
) )
} }
.onChange(of: item.content) { newText in .onChange(of: item.content) { newText in
self.textHeight = self.estimatedHeight( self.textHeight = self.estimatedHeight(
for: newText, for: newText,
width: screenSize().width - 16 width: screenSize().width - 42
) )
} }
@ -135,6 +135,7 @@ struct CreatorCommunityAllItemView: View {
.padding(.vertical, 11) .padding(.vertical, 11)
.background(Color.gray22) .background(Color.gray22)
.cornerRadius(5.3) .cornerRadius(5.3)
.padding(.horizontal, 13.3)
} }
private func estimatedHeight(for text: String, width: CGFloat) -> CGFloat { private func estimatedHeight(for text: String, width: CGFloat) -> CGFloat {

View File

@ -56,7 +56,6 @@ struct CreatorCommunityAllView: View {
} }
} }
} }
.padding(5.3)
} }
} }
.sheet( .sheet(