ToolbarItem bottomBar

Asked 1 years ago, Updated 1 years ago, 422 views

In swiftui

In ToolbarItem

If you want to set it to the bottom right,

ToolbarItem(placement:.bottomBar)

If so,

It does not appear.

What should I do?

swiftui

2022-11-14 15:33

1 Answers

It must be declared under NavigationStack.

struct ContentView:View {  
  varbody:someView {
    NavigationStack {
      Text ("Hello")
        US>.toolbar{
          ToolbarItem(placement:.bottomBar){
            Button("Button"){}
          }
        }
    }
  }
}


2022-11-15 05:25

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.