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
1
vote
2 answers

SwiftUI: How to pass a dynamically generated parameter to child View via NavigationLink?

I want to put three links in a NavigationView. First link: Displays a RoomView with a specific room ID, "room.A" Second link: Displays a RoomView with a specific room ID, "room.B" Third link: Displays a RoomView with a randomly generated room ID…
1
vote
0 answers

SwiftUI three column navigation layout not closing when selecting same item

I'm using a three column navigation layout and facing the issue, that when selecting the same second column's item, the drawers won't close. If I take the files app as reference, selecting the same item again will close the drawer. Can someone tell…
1
vote
0 answers

How do I create a simple app with a side bar in SwiftUI?

I've had my app inside a NavigationView using the StackNavigationViewStyle style for some time with no problems. Recently I wanted to add a sidebar to it though, so I thought I should try using the DoubleColumnNavigationViewStyle style for this. At…
Hamster
  • 133
  • 3
  • 12
1
vote
0 answers

SwiftUI Navigation does not remove previous view

in one of my SwiftUI views I have this Navigation link NavigationLink(destination: SomeView(), isActive: .constant(true)) { }.hidden() and I also disabled the navigation bar on all my views. The NavigationLink is rendered if a certain condition…
1
vote
0 answers

SwiftUI List inside NavigationView with selection unexpected behavior

Compare the behavior of this two following code snippet; target iOS 14.4 iPad(4th gen) simulator, Xcode Version 12.4 (12D4e): First: struct experimental: View { @State private var selection: Int? = 0 var body: some View…
1
vote
1 answer

Custom NavigationView top bar

I want to create a design similar to the image above. To create the bottom TabView, I used this code: import SwiftUI struct ParentTabView: View { var body: some View { TabView { HomeView() .tabItem { …
Liviu
  • 142
  • 4
  • 11
1
vote
1 answer

SwiftUI: Tapping navigation bar in landscape list does not scroll list to top

Has anyone else come across this incorrect behavior? Create an app with the following code: import SwiftUI struct ContentView: View { var body: some View { NavigationView { List { ForEach (0..<100,…
1
vote
0 answers

Render swiftui NavigationLink on the bottom of the screen (and not on the side) on MacOS?

Got this simple swiftui NavigationView example. Works fine, but is there anyway to have the List on the top half of the window en the "destination" on the bottom half of the window? I was looking for some modifiers, but getting the impression this…
1
vote
1 answer

how can I hide tab bar in specific screens in SwiftUI?

How to hide the tabBar in specific screens? I'm navigating from login to directly to tabBar. Is there any way to hide? In UIKit we're hiding by pushing and I have no idea how to do it in SwiftUI, by presenting the view not going to work. Here is my…
achinthaishane
  • 77
  • 1
  • 2
  • 9
1
vote
2 answers

SwiftUI - Reload View from NavigationView on Back button is pressed

I have a NavigationView on my app. From mainView I open with NavigationLink MessagesView and from inside MessagesView I open with NavigationView ChatView. On ChatView i've made a backButton, but when I press the backButton I don't know how to make…
Silviu
  • 145
  • 2
  • 10
1
vote
1 answer

SwiftUI Clear Background on List Element

I have a list that produces card views with a ForEach. They are meant to have a clear background, but one of them always has a white background and I can't figure out how to change it. I have tried putting .background(Color.clear) on any view I can…
Ethan Hardacre
  • 125
  • 2
  • 12
1
vote
0 answers

SwiftUI macOS cannot change main menu when a NavigationView is present

I try to change some items of the main menu in my SwiftUI macOS app. I don't have macOS Catalyst yet, where the UIKit and UIMenuBuilder comes into play. I want to create my app for macOS versions below Catalyst as well. I added an AppDelegate where…
Cravid
  • 653
  • 2
  • 7
  • 22
1
vote
1 answer

Building navigation between Views in my iOS app

As the time flies, by App get more and more complicated shape. In some cases the App flow might be: View A -> View B -> C -> D and then back D -> C -> B -> A.. but sometimes i need to skip the view and go D -> B -> A.. In some cases its A -> C -> D…
eugene_prg
  • 948
  • 2
  • 12
  • 25
1
vote
1 answer

SwiftUI NavigationView Not Fully Extending In View

I am working with NavigationView in SwiftUI and having an issue with it extending fully to the bottom of the screen. I created a simple List in and this works fine. However, when I put it in a NavigationView, it creates a gray area at the bottom.…
jonthornham
  • 2,881
  • 4
  • 19
  • 35
1
vote
1 answer

Remove space NavigationTitle but not the back button

I want to remove the NavigationTitle Space without removing the back button. I have already tried this: .navigationBarItems(trailing: NavigationLink(destination: Preferences(viewModel: viewModel).navigationBarHidden(true)) { …
user14870547