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
0
votes
2 answers

SwiftUI view is in the middle instead of in the top - NavigationView

I am trying to create a navigation view in SwiftUI - I want to navigate from the login form to the Home Screen. In the preview, the Home Screen is looking how it should, but on the live preview - it is centered in the middle of the screen. I tried…
0
votes
1 answer

SwiftUI - NavigationBarTitleDisplayMode - Change title dynamically based on mode

Is there a way to get notified when the .navigationBarTitleDisplayMode (which is set to .automatic) of a view changes from .large to .inline or vice versa? Something like an @Environment object similar to @Environment(\.locale) var locale:…
Peanutsmasher
  • 220
  • 3
  • 13
0
votes
2 answers

view display on the right of the window

hello i have an issue with my project on Xcode when I use navigation view, the window display not normally and appear on the right of the window already displayed, here is the code. NavigationLink(destination: Acceuil()) { …
0
votes
1 answer

Swiftui nested navigation issue while using navigation link

My swiftui application structure looks like this Navigation View (enclosing the landing view that is a list view ) On selection of a List item Navigation link directs to a Tab View with three tabs (default first tab) When I use a sole standalone…
0
votes
1 answer

SwiftUI - Unexpected Animation within NavigationView

I have 3 Text View in a VStack, and I want the middle one to bounce by using scaleEffect. However, there is some additional unexpected up and down animation. I found that once I remove the view from NavigationView, it will behave normal. Is the…
keanehui
  • 185
  • 2
  • 13
0
votes
0 answers

SwiftUI - Error with content in a view component

I'm trying to build a reusable navigation tab in SwiftUI and I'm facing some challenges. I come from ReactJS and wanted to create a component that I can pass the tab images and the different views. This is the code I have so far which works pretty…
0
votes
1 answer

SwiftUI Pop To Root DeInit Class

UPDATE: Added more code examples so that a working minimal example was provided. On the main screen of my app the user can select from a few different options. One of which is to create a new user account, which is a multi-page form utilizing a…
kittonian
  • 1,020
  • 10
  • 22
0
votes
1 answer

How to set the color of unsafe area in a NavigationView

I want the color above the titlebar of NavigationView to remain the same, even when I scroll the list. I've tried using UINavigationBar to set it, but it doesn't work in unsafe area, and tt still turns gray when sliding down. import SwiftUI struct…
Hz Shang
  • 105
  • 1
  • 9
0
votes
1 answer

Toolbar disappears when StackNavigationViewStyle on iPad | SwiftUI iOS 15

I have this TabView: ZStack(alignment: Alignment(horizontal: .center, vertical: .bottom)){ TabView(selection: $mainViewProperties.currentView) { ... //HOME NavigationView{ …
0
votes
1 answer

(SwiftUI) can anyone tell me why my NavigationView is creating extra NavigationBars and blank space in the footer? (video included)

I have an app with 3 views. they are connected by a NavigationView and have NavigationLinks that link to the next view. however, all views are created with an extra NavigationBar and with lots of blank white space on the bottom that travels up the…
zamanada
  • 158
  • 13
0
votes
2 answers

SwiftUI ColorPicker cause pop to root view

I have this weird issue. When I click the ColorPicker, the view dismissed and pop back to the root view. I have attach a screen record below. Anyone have idea how to fix this issue? The code run on simulator ios 15.2 See screen record here import…
0
votes
0 answers

Navigation title is inlined instead of large

This is my code: struct CardView: View { var body: some View { Rectangle() .fill(Color.red) .frame(width: 170, height: 85) } } struct ListView: View { let data = (1...100).map { "Item \($0)" } let…
Edward
  • 3
  • 4
0
votes
0 answers

Set NavigationBar hidden the search is no longer available

I try to use the new .searchable feature. The following code works as expected: import SwiftUI struct ContentView: View { @State private var searchText = "" var body: some View { NavigationView { List { …
madcat
  • 322
  • 3
  • 14
0
votes
1 answer

SwiftUI NavigationView Coordinator Issue

I made an example to demonstrate how I tried to exclude navigation states from views. The problem is that somehow storing the navigation states in an ObservableObject breaks navigation. After tapping the "Show SecondDetailView" NavigationLink, the…
Spriter
  • 611
  • 1
  • 5
  • 12
0
votes
1 answer

How to add conditional ToolbarItems to NavigationView Toolbar with SwiftUI?

I am trying to add an icon button to the leading edge of a NavigationView's toolbar - but I want that button to only be visible when the device is in landscape mode. (Kinda like how the default Notes app works) I have the following code: var body:…
Vidur
  • 1,442
  • 2
  • 17
  • 37