How do you get views to align with the navigation bar items? This can be done in a UIKit app via view.layoutMarginsGuide.
Here’s an example:
var body: some View {
NavigationView {
VStack {
Text("Lorem ipsum nunc fermentum euismod.")
.background(Color.gray)
.padding() //FIXME
.navigationBarTitle("Title")
.navigationBarItems(leading: Button("Hello"){}, trailing: Button("World"){})
Spacer()
}
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity, alignment: .topLeading) //make it fill the width
}
.navigationViewStyle(StackNavigationViewStyle())
}
This gives the following results on iPad 9.7" portrait and iPhone 11 Pro:




