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
3
votes
4 answers

Why is viewModel not deiniting with a NavigationView?

I've got a problem with an object not being destroyed when put into the environment and used with a NavigationView. If a view creates an object, creates a NavigationView and inserts the object into the environment, then when that view disappears the…
3
votes
1 answer

navigate with NavigationStack swiftUI

I am new to SwiftUI framework I am trying to implement NavigationStack. I want to navigate on button action instead of using NavigationLink. The reason behind that is, I need to navigate once a particular function get performed on button…
3
votes
1 answer

View shifts downward upon navigation link in Swift

I am having a weird issue when I try to navigate back and forth between different views. On WelcomePage, when the user clicks sign in, they are directed to HomePage. HomePage has a navigation bar. Right now, all of the items on the nav bar redirect…
3
votes
2 answers

SwiftUI: NavigationView detail view pops backstack when previous's view List changes

I have a List of ids and scores in my first screen. In the detail screen I click and call a callback that adds to the score and resorts the List by the score. When I do this with an item at the top of the list, nothing happens. (Good) When I do this…
mmm111mmm
  • 3,607
  • 4
  • 27
  • 44
3
votes
1 answer

swiftui list with custom header

I want to set a image header for list in swiftui. The effect I want is shown in the figure below: However, I can not remove padding in this image row. My code is as bellow: import SwiftUI struct ContentView: View { var body: some View { …
mars
  • 109
  • 5
  • 21
3
votes
1 answer

SwiftUI NavigationView content only visible in iPad sidebar

My app is working as expected across all iPhone models, but when running on iPad I notice that the my application content, which is wrapped within a NavigationView, only displays in the iPad's sidebar, and only after tapping the 'Back` toolbar…
John Harrington
  • 1,314
  • 12
  • 36
3
votes
1 answer

NavigationView back button not showing

Have a simple NavigationView with fixed content on both sides. The left pane just shows a couple of buttons and the right pane shows a graph using an NSView wrapped in an NSViewRepresentable. When viewing on iPad in portrait mode, the left pane…
CodeBuddy
  • 427
  • 4
  • 14
3
votes
0 answers

How do you disable the Delete swipe gesture except for EditMode?

Can anyone tell me how to disable the Delete swipe action for a list of items inside a NavigationView, while retaining the ability to delete list items when the NavigationView is in edit mode. I have tried conditionally passing a closure or nil to…
jdelano
  • 206
  • 1
  • 8
3
votes
1 answer

Navigating to detail view on button click in List Row(TableviewCell) in SwiftUI

I have List/TableView with Cells. Now each cell contains detail about given Item and some buttons like Edit the Item, Show Detail of Item, Show subview of given Item etc. Now, for case of showing detail of Item, I have tried to add NavigationLink,…
3
votes
0 answers

SwiftUI - Custom Navigation Bar/ ToolBarItem gets cut off on second viw

I am currently in the process of creating a flow for my app, however due to the required appearance of the navigation bar being larger than normal, I have created a custom nav bar and have added it to the toolbar component. I only have the…
3
votes
1 answer

Navigationbar title is inline on pushed view, but was set to large

I want a large title in the navigationbar on a pushed view in SwiftUI and an inline title on the parent view. When the parent navigation bar display mode is not set, it works: Working without display mode on parent But when I set the display mode in…
3
votes
0 answers

SwiftUI Searchable several views down from NavigationView?

I'm having problems related to .searchable and am wondering if it's related to my application's view hierarchy. The examples I can find for using Searchable say to use it on the NavigationView directly, and show it like so: var body: some View { …
dachary
  • 31
  • 5
3
votes
2 answers

Navigation Title is not showing on SwiftUI

The navigationTitle is not working. I use Swift5.5.2 In the preview there is no sign of the navigation title just an empty space. struct ContentView: View { @State private var firstname = "" @State private var lastname = "" @State…
Jena.T
  • 43
  • 4
3
votes
2 answers

Additional safe area on NavigationView in SwiftUI

I am building a SwiftUI app where I have an overlay that is conditionally shown across my entire application like this: @main struct MyApp: App { var body: some Scene { WindowGroup { NavigationView { …
3
votes
1 answer

Swiftui NavigationView + TabView doesn't show navbar item

I have four Views inside a TabView and each of them contains NavigationView with title. However, when the view first shows up, the navigation view does not show as designed. Even though I have the navigation bar item, the view would always be a…
cc nn
  • 115
  • 1
  • 1
  • 7