ToolbarItem bottomBar

Asked 2 years ago, Updated 2 years ago, 456 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.