Questions tagged [swiftui-navigationview]

For questions about NavigationView - a view in Apple's SwiftUI framework that presents a stack of views representing a visible path in a navigation hierarchy. When using this tag also include the more generic [swiftui] tag where possible.

Links:

583 questions
213
votes
26 answers

How to remove the default Navigation Bar space in SwiftUI NavigationView

I am new to SwiftUI (like most people) and trying to figure out how to remove some whitespace above a List that I embedded in a NavigationView. In this image, you can see that there is some white space above the List. What I want to accomplish is…
Vapidant
  • 2,532
  • 2
  • 12
  • 26
34
votes
4 answers

How to disable NavigationView push and pop animations

Given this simple NavigationView: struct ContentView : View { var body: some View { NavigationView { VStack { NavigationLink("Push Me", destination: Text("PUSHED VIEW")) } } } } Did…
kontiki
  • 37,663
  • 13
  • 111
  • 125
32
votes
3 answers

SwiftUI – How to set the title of a NavigationView to large title (or small)?

Using SwiftUI how do I change the navigation bar's title size? Choosing between a standard or a large title.
29
votes
1 answer

SwiftUI iOS14 - NavigationView + List - Won't fill space

I'm having an issues with a List inside a NavigationView since iOS 14 update. Here is a simple breakdown of the code - I've striped everything that doesn't show the issue struct ContentView: View { var views = ["Line 1", "Line 2", "Line…
28
votes
5 answers

macOS SwiftUI Navigation for a Single View

I'm attempting to create a settings view for my macOS SwiftUI status bar app. My implementation so far has been using a NavigationView, and NavigationLink, but this solution produces a half view as the settings view pushes the parent view to the…
19
votes
5 answers

Make List Sections non-collapsible in SwiftUI when embedded into a NavigationView SwiftUI

When I embed a List grouped into Sections into a NavigationView the section headers become collapsible. I'd like to keep them non-collapsible, just like when the List is not embedded into the NavigationView. My current code (with the…
Tamas
  • 3,254
  • 4
  • 29
  • 51
17
votes
1 answer

SwiftUI .toolbar disappears after following NavigationLink and coming back

I've added a .toolbar to the top level of a NavigationView that will eventually be used to select items in a list without using swipe gestures (up button, down button, etc.). I also have a .navigationBar going on, to access other views for Account…
16
votes
7 answers

SwiftUI Hide TabView bar inside NavigationLink views

I have a TabView and separate NavigationView stacks for every Tab item. It works well but when I open any NavigationLink the TabView bar is still displayed. I'd like it to disappear whenever I click on any NavigationLink. struct MainView: View { …
pawello2222
  • 46,897
  • 22
  • 145
  • 209
15
votes
4 answers

How do you fix Xcode 14 warning: NavigationLink presenting a value must appear inside a NavigationContent-based NavigationView. Link will be disabled

Since installing Xcode 14, I am now getting the following error message printed in my console: NavigationLink presenting a value must appear inside a NavigationContent-based NavigationView. Link will be disabled. My app is structured as…
12
votes
3 answers

Where to place global NavigationPath in SwiftUI

I'm currently developing an app using NavigationStack. I wonder where should I put the NavigationPath variable so I can modify it anywhere. I tried to put it inside the root view as a State variable, but it seems difficult for me to modify it inside…
wheatset
  • 339
  • 1
  • 7
12
votes
3 answers

SwiftUI Navigation popping back when modifying list binding property in a pushed view

When I update a binding property from an array in a pushed view 2+ layers down, the navigation pops back instantly after a change to the property. Xcode 13.3 beta, iOS 15. I created a simple demo and code is below. Shopping Lists List Edit List…
12
votes
1 answer

SwiftUI - NavigationView title and back button clipped under status bar after orientation change

Whenever I rotate the device to landscape and back again, the top of the NavigationView (including the title and back button) get clipped under the status bar. Minimal reproducible example: struct ContentView: View { var body: some View { …
aheze
  • 24,434
  • 8
  • 68
  • 125
11
votes
1 answer

What is the difference between navigationBarTitle and navigationTitle modifiers in SwiftUI 2.0?

Learning all the new SwiftUI 2.0 changes but came across .navigationTitle which seems to work almost exactly like .navigationBarTitle. I looked at the WWDC 2020 videos and found one video where it was mentioned as being used to distinguish tab…
Super Noob
  • 750
  • 8
  • 17
10
votes
5 answers

SwiftUI: how to change NavigationView.toolbar background color

Any idea on how to apply a specific background color to the bottom toolbar? NavigationView { List { .... } .toolbar { ToolbarItem(placement: .bottomBar) { Button(action: { model.selectTab(tab: "ITEM1") },…
Daniele B
  • 19,801
  • 29
  • 115
  • 173
9
votes
0 answers

Keep navigation bar title during search with Searchable

Is it possible to not hide the Title in Navigation Bar in search mode using Searchable? Using the code below Title in Navigation Bar is hidden when Search Field is focused. NavigationView { } .searchable(text:…
Bogdan
  • 181
  • 1
  • 5
1
2 3
38 39