fix(component): 텍스트 탭 가로 스크롤을 적용한다
This commit is contained in:
@@ -11,6 +11,7 @@ struct TextTabBar<Item: Hashable>: View {
|
|||||||
let title: (Item) -> String
|
let title: (Item) -> String
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
ScrollView(.horizontal) {
|
||||||
HStack(alignment: .center, spacing: SodaSpacing.s20) {
|
HStack(alignment: .center, spacing: SodaSpacing.s20) {
|
||||||
ForEach(items.prefix(3), id: \.self) { item in
|
ForEach(items.prefix(3), id: \.self) { item in
|
||||||
Button {
|
Button {
|
||||||
@@ -19,15 +20,16 @@ struct TextTabBar<Item: Hashable>: View {
|
|||||||
Text(title(item))
|
Text(title(item))
|
||||||
.appFont(.heading3)
|
.appFont(.heading3)
|
||||||
.foregroundColor(selectedItem == item ? Color.white : Color.gray600)
|
.foregroundColor(selectedItem == item ? Color.white : Color.gray600)
|
||||||
|
.fixedSize(horizontal: true, vertical: false)
|
||||||
.frame(height: 52, alignment: .center)
|
.frame(height: 52, alignment: .center)
|
||||||
.contentShape(Rectangle())
|
.contentShape(Rectangle())
|
||||||
}
|
}
|
||||||
.buttonStyle(.plain)
|
.buttonStyle(.plain)
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer()
|
|
||||||
}
|
}
|
||||||
.padding(.horizontal, SodaSpacing.s20)
|
.padding(.horizontal, SodaSpacing.s20)
|
||||||
|
}
|
||||||
|
.scrollIndicators(.hidden)
|
||||||
.frame(maxWidth: .infinity)
|
.frame(maxWidth: .infinity)
|
||||||
.frame(height: 52, alignment: .leading)
|
.frame(height: 52, alignment: .leading)
|
||||||
.background(Color.black)
|
.background(Color.black)
|
||||||
|
|||||||
Reference in New Issue
Block a user