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

Show UIKit PopUp in SwiftUI View

This question is quite similar to this question however, the solution there does not work for me. I have a predominantly UIKit app and now we are building some views using SwiftUI. To show alert pop ups, we are using this SwiftMessages library For…
0
votes
0 answers

Swiftui navigation view principal item on detail view

i have swiftui application for min target ios 15. In my ux design is logo on every page. on ios 16 following good NavigationView { List(data, id: \.id) { item in DetailKeyComponent(item: item, withArrow: true) .overlay { …
0
votes
0 answers

Transparent NavigationView SwiftUI

I am trying to make a transparent NavigationViewso that there is no moving picture in the background. if I add opacity to NavigationView, I see the desired image .background(Color.clear) dont work ZStack { Color("FF0000").background( …
0
votes
1 answer

Remove background from NavigationStack in SwiftUI

In my app, I want to construct a single background view under my NavigationStack and then show that same background underneath other views that I navigate to via NavigationLinks. I am trying to do this by putting the NavigationStack and my…
0
votes
1 answer

Dismiss all the NavigationLink View to go back to Starting View from the third View

This is a simple code that I am trying to test for my required feature. I want to be able to click on the button or something to take me back to the FirstView without me needing to click the back button each time. I found that if I add another…
0
votes
1 answer

How to perform nested navigation in visionOS

I'm displaying a simple NavigationStack with some options, which navigate to a component with a NavigationView that looks something like this: NavigationView { List(courseMetadata.lessons, selection: $selection) { lesson in …
0
votes
0 answers

Auto-selection of a item from a list of items and navigate to a view which focus on the selected item

Hi I'm new to swiftUI and I'm stuck in a issue. Description: The problem is to navigate to a screen of different tab. Ex: I have a view in tabItemB which displays a selected list of student id's who belong to different class sections like class 5A…
0
votes
0 answers

SwiftUI, problem with my Textfield and keyboard

this is my first post and I'm here because I've got a problem in my swiftUI code. Let me quickly explain: I have an application with a SignInView, which allows you to register on the application. Once you've given your credentials, you're redirected…
0
votes
1 answer

Make the hit testing for a NavigationLink from a Rectangle with plain button style and no foregroundColor (clear Color) include the empty space

The problem is to make a NavigationLink from a Rectangle which: does not have a foreground color (or has a Color.clear foreground color) and has buttonStyle set to PlainButtonStyle() or .plain (to remove the blue text overlay) have hit testing…
0
votes
0 answers

NavigationSplitView run time error when collapse and expand Sections

The code I test is the following. ContentView: import SwiftUI let dataSourceSection1 = [Folder(id: 1, name: "Folder1"), Folder(id: 2, name: "Folder2")] let dataSourceSection2 = [Folder(id: 3, name: "Folde3"), Folder(id: 4, name: "Folder4")] struct…
0
votes
1 answer

How to apply .presentationBackground modifier to a second view in a sheet with NavigationLink?

Been searching around online for a while and can't seem to find an answer to help me with this problem, since the .presentationBackground modifier is so new. Problem: When applying the .presentationBackground modifier to a presented sheet, the…
0
votes
2 answers

Conflicting arguments to generic parameter Content, RowContent when using a custom view is used inside List and NavigationView

I'm trying to create a simple ToDo App for practice. I created a DataModel for struct Task and tried to use it to iterate in a List in a NavigationView. When I write code like this, it works fine. import SwiftUI struct ContentView: View { var…
Buddha
  • 4,339
  • 2
  • 27
  • 51
0
votes
1 answer

Losing selection of list in NavigationView

I am trying to keep the selection to remain highlighted when navigating back from the destination of the NavigationLink. This code running on iPhone 14 simulator on iOS 16 deselects the current selection or selects 2 items and the count of selected…
Fred Klein
  • 448
  • 6
  • 13
0
votes
1 answer

NavigationView doesn't update when @State changes (NavigationStack works well)

I encountered this situation when trying to replace my NavigationStack (iOS 16+) by a NavigationView (for backward compatibility reasons). What I hoped for would be that NavigationStack and NavigationView would have similar behavior since Swift UI…
0
votes
0 answers

MacCatalyst toolbar increases in height with .principal placement (SwiftUI)

I am developing an macCatalyst app with a simple NavigationView and a toolbar. As soon as I give my toolbarItem the .principal placement the toolbar increases in height (nearly doubles). In the Image you can see the large Space between "MyButton"…