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
2
votes
1 answer

SwiftUI - Remove extra space in NavigationBar after transitioning back to Home view from subview

I am new to SwiftUI and have run into a little challenge. Whenever I go from my Home view to a sub-view and then back to the Home view, I am seeing extra space created in the Navigation view (see linked GIF). I was wondering if anyone had any advice…
Ron
  • 29
  • 6
2
votes
1 answer

ios15 half-swiping back while hiding the navigation bar leaves a top empty space - SwiftUI

I am working on a project where I have a custom navigationBar, which means I need to manage the back button and swipe back gesture myself. I didn't experience any problems in the past, but now when I try to swipe back and stop in the middle of the…
Liviu
  • 142
  • 4
  • 11
2
votes
1 answer

SwiftUI: Custom label in navigation link is greyed out

I'm trying to use my custom card view as label to navigation link. this navigation link is also a Grid item. The result is a My Card Code: struct CityCard: View { var cityData: CityData var body: some View { VStack { …
2
votes
2 answers

SwiftUI NavigationView pops back when updating observableObject

Background: I have been stuck on this annoying problem for days, trying different solution and searching stackoverflow etc for answers; some have had similar problems but no suggested solution had the desired effect. The problem is that when…
2
votes
1 answer

SwiftUI NavigationView nested in PageTabView wrong aligned on first appear

The NavigationViews inside my PageTabView are wrong aligned on first appear. When i scroll to another page on my PageTabView and go back to the first page, the alignment is correct. The content of the navigationview (red) is beneath the…
2
votes
2 answers

iOS 15 SwiftUI Conditionals on a view with Navigation View makes NavigationBar config to be ignore if navigationViewStyle stack

been searching for this everywhere and can't find anything around this, I believe is a bug, maybe is not. I need NavigationView with .navigationViewStyle(.stack) to have it stacked on the iPad and make it look the same as the iphone, now suppose you…
Javier Vieira
  • 2,100
  • 20
  • 23
2
votes
2 answers

Dynamically change and update color of Navigation Bar in SwiftUI

I'm trying to change the NavigationBar background color in SwiftUI which I have done with the following code. However, I have yet to figure out how I can dynamically change and update the background color of the navigation bar. struct ContentView:…
2
votes
1 answer

SwiftUI and NavigationView: title's displayMode not working correctly

I'm writing a new SwiftUI app that heavily use NavigationView to move across various views. The behaviour of the navigationBarTitle however is really strange: when moving to a page with a long, scrollable content and getting back, the displayMode,…
Valerio
  • 3,297
  • 3
  • 27
  • 44
2
votes
1 answer

SwiftUI Segmented picker inside Navigation Bar and below navigation title

What Im trying to achieve is to have a segmented picker inside the navigation bar, but below the title of the navigation bar while still having the collapse animation. For example instead of the search, I need a segmented…
2
votes
1 answer

SwiftUI NavigationView Starting Inside Itself

So I've got a NavigationView embedded inside of a TabView that is in the Page View Style. Upon first load the NavigationView will start inside itself, and then once reloaded it shows normally. I am unsure as to what is causing this. And I've made a…
2
votes
1 answer

SwiftUI Search Bar in line with navigation bar

Does anyone have working Swiftui code that will produce a search bar in the navigation bar that is inline with the back button? As if it is a toolbar item. Currently I have code that will produce a search bar below the navigation back button but…
mdav132
  • 125
  • 2
  • 11
2
votes
1 answer

Navigation View -Notes Like Sidebar - Toggle button

I am very new to iOS development and Swift UI. I am making an app for our company. I believe Apple Notes like approach is best. I got most working tanks to some Udemmy courses and a couple of weeks of intense Googling. But I can't figure out how to…
Ziyan Junaideen
  • 3,270
  • 7
  • 46
  • 71
2
votes
1 answer

Swiftui view not updating list after data append to array

I have three files: AddAssignment, ViewAssignment and Task. A button is clicked on AddAssignment.swift which successfully appends form data to an array inside of Task.swift. However, in a file AddAssignment.swift, where each item in this array is…
2
votes
1 answer

SwiftUI Navigation View doesn't have enough space before content

I've got a SwiftUI Navigation View and the content views inside have a very small amount of space between the navigation bar and the content. Here's my code: struct TestView: View { var body: some View { ZStack(alignment: .top) { …
user3067870
  • 556
  • 1
  • 6
  • 17
2
votes
0 answers

Keeping/saving view state using a navigationview when switching from one tab to another

I have a ContentView quite simple with a toolbar enabling selection among some more complex secondary views: enum SelectedTab { case checklist case altitude } @State var selectedTab: SelectedTab? var body:…
aerofel
  • 21
  • 1