在文件 App 中,当您按下选择按钮后,选项卡栏会切换到工具栏。
我该如何使用 SwiftUI 实现这个功能?(在选项卡栏和工具栏之间进行切换)
![enter image description here](https://istack.dev59.com/hOvUf.webp)
struct tabBar: View {
var body: some View {
TabView {
ContentView().tabItem {
Image(systemName: "paperplane.fill")
Text("tabBar")
}
}
.toolbar {
ToolbarItem(placement: .bottomBar, content: {
Button(action: {
}){
Text("toolBar1")
}
})
ToolbarItem(placement: .bottomBar, content: {
Button() {
} label: {
Text("toolBar2")
}
})
}
}
}