UINavigationController, Nav Bar buttons incorrect layout on iPhone Duo

When presenting a UINavigationController presented via UIViewControllerRepresentable in a sheet, the top nav bar buttons aren't correctly moving to the side bar on the front screen of the Duo. They do re-orient vertically, but they do so next to the side bar and not within it.

What am I doing wrong? This is how I am setting the buttons:

            let trimButton = UIBarButtonItem(image: UIImage(systemName: "selection.pin.in.out"), style: .plain, target: self, action: #selector(enterTrimming(_:)))

            navigationItem.leftBarButtonItem = trimButton
            navigationItem.rightBarButtonItem = cancelButton

            navigationItem.leftBarButtonItem?.isEnabled = true
            navigationItem.rightBarButtonItem?.isEnabled = true

Answered by swiftuiforever in 909073022

Have you tried ignoring the horizontal safe area? Or alternately using NavigationStack instead of using UINavigationController via UIViewControllerRepresentable

Accepted Answer

Have you tried ignoring the horizontal safe area? Or alternately using NavigationStack instead of using UINavigationController via UIViewControllerRepresentable