1

I'm having an issue with navigationBarItems and list.

If I add a navigationBarItems, my list is moved slightly to the right (red line). When I remove the navigationBarItems, the list begins on the blue line.

Is this a normal thing? What am I doing wrong?

struct ContentView: View {
    var body: some View {
        NavigationView {
            List {
                Text("Item 1")
                Text("Item 2")
                Text("Item 3")
                Text("Item 4")
            }
            .navigationTitle("Home")
            .navigationBarItems(trailing:
                NavigationLink(destination: EmptyView()) {
                    Image(systemName: "plus.circle.fill")
                })
        }
    }
}

enter image description here

pawello2222
  • 46,897
  • 22
  • 145
  • 209

0 Answers0