copinism-ios/copinism/Components/TabbarView.swift
2024-06-04 09:41:01 +08:00

75 lines
1.7 KiB
Swift

//
// TabbarView.swift
// copinism
//
// Created by on 2024/6/4.
//
//
//
import SwiftUI
struct TabbarView: View {
@Binding var active: Selection
var body: some View {
HStack {
Spacer()
Button {
active = .home
} label: {
Text("首页")
.SetTextStyle(size: 16, color: active == .home ? .black : .gray)
}
Spacer()
Button {
active = .sopping
} label: {
Text("购物")
.SetTextStyle(size: 16, color: active == .sopping ? .black : .gray)
}
Spacer()
// Button {} label: {
// Image(systemName: "plus")
// .padding(.horizontal, 12)
// .padding(.vertical, 6)
// .foregroundStyle(.white)
// .background(.red, in: RoundedRectangle(cornerRadius: 8))
// }
Spacer()
Button {
active = .message
} label: {
Text("消息")
.SetTextStyle(size: 16, color: active == .message ? .black : .gray)
}
Spacer()
Button {
active = .mine
} label: {
Text("")
.SetTextStyle(size: 16, color: active == .mine ? .black : .gray)
}
Spacer()
}
.foregroundStyle(.black)
}
}
// #Preview {
// TabbarView()
// }