Home > Mobile >  Swift: Why does the iPad/Mac app version look weird
Swift: Why does the iPad/Mac app version look weird

Time:12-26

How can I fix this? It's showing up on my Mac iPad. On iPhone is looks normal. I don't really know what to add besides an ss, so if you need anything, please ask. Thanks in advance. enter image description here

CodePudding user response:

You are likely referring to the navigationViewStyle

The iPad and Mac have a DefaultNavigationViewStyle of DoubleColumnNavigationViewStyle/columns and the iPhone has a default of StackNavigationViewStyle/stack.

If you haven't set it it will change with the device. If you add the line below to your code on the upper most View it will likely "appear" to be fixed.

.navigationViewStyle(.stack)

If you are using SwiftUI.

  • Related