How to use NavigationView{} without having a sidebar show up on iPadOS

Hello,
New iOS coder here! I am wondering if there is a way that I can use NavigationView without the iPad version of the app creating a sidebar. I am making an application that does not make since to have a sidebar on it.

Again, I'm a complete beginner so a detailed explanation would be much appreciated!

Peace!



PS:
I want to make my NavigationView (That is the sidebar of iPad app and main of iPhone app) to be stretched out throughout the whole iPad screen.
Hi,
NavigationViews are, depending on device and orientation, displayed in a few different ways. To achieve what you want you need to modify the NavigationView using:
Code Block swift
NavigationView{
Text("View")
}.navigationViewStyle(StackNavigationViewStyle())

Take care,
David

I think you are after

NavigationStack {
TabView {
}
}.navigationViewStyle(StackNavigationViewStyle())

I understand it's an old post. and you probably have moved on. but it is a commonly high hit on google when searching.

How to use NavigationView{} without having a sidebar show up on iPadOS
 
 
Q