Ghost Padding on NavigationBarPlatterContainer

Hello,

I have a SwiftUI View sitting in the UIHosting view controller. On rotation to landscape, the system would add padding to the toolbar. I presume it's the nav bar.

Anyone experienced this? What would be this space? padding? content margin?

Answered by DTS Engineer in 861669022

Could you please file a feedback report and include a sample project. That would be helpful in understanding and investigating the issue.

Please post the Feedback ID number here once you do.

Could you please file a feedback report and include a sample project. That would be helpful in understanding and investigating the issue.

Please post the Feedback ID number here once you do.

Here's an sample code that can produce the problem. It happens on rotate in simulator, only in iOS 26.*

Expectation: should have the same lead spacing regardless of the rotation of the device.

struct ContentView: View {
    @State private var showingSharePopover = false

    var body: some View {
        NavigationStack {
            VStack {
                Button {
                    showingSharePopover = true
                } label: {
                    Label("Show Share Options", systemImage: "square.and.arrow.up")
                        .font(.title2)
                        .padding(.vertical, 10)
                        .padding(.horizontal, 20)
                }
                .buttonStyle(.borderedProminent)
                .tint(.indigo)
                .controlSize(.large)
                .shadow(radius: 5)
                .sheet(isPresented: $showingSharePopover, content: {

                })
            }
            .navigationBarBackButtonHidden(false)
            .toolbar {
                ToolbarItem(placement: .topBarLeading) {
                    Button {
                        
                    } label: {
                        HStack {
                            Image(systemName: "square.and.arrow.left")
                            Text("Done")
                        }
                    }
                }
            }
            .padding()
        }

    }
}

Ghost Padding on NavigationBarPlatterContainer
 
 
Q