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

SwiftUI retuning List or NavigationView in body: difference of return List and List in body

I have question about returning NavigationView and List inside of SwiftUI body There are code snippets like this: var body: some View { let trailingItem = HStack { Button(action: { print("Button 1") }) { Image(systemName:…
Dan Choi
  • 83
  • 2
  • 8
0
votes
1 answer

Set a value to default which constantly changes

I am creating a game where I have a value of highscore which I want to save each time it is updated even if I exit the app. I have already the value of highscore which updates eveyrtime the score > highscore but if I exit the app, it the highscore…
0
votes
1 answer

Why the ToolbarItem Button is not tappable?

I have a navigationView with the ToolbarItem containing a button. This button is not tappable correctly. To move to the next screen i have to tap underneath. As you can see from the Debug View Hierarchy: Here is how i am adding the button to the…
DanielZanchi
  • 2,708
  • 1
  • 25
  • 37
0
votes
0 answers

NavigationView witout TabBar

Is there a way to remove the Tabbar from a page? The flow I have is to start session .. have a page with a menu of three tabs, one of them is the profile page in it is the logout, what I do here is: clear the UserDefaults and navigate back to the…
0
votes
1 answer

NavigationLink inside a List and VStack does not work after the first pop

I am trying to use the new Pull to Refresh feature in the latest version of SWiftUI which requires a List. Enclosing the VStack in a List causes the NavigationLink to work only once. Below is a simple version of the code without the Pull To Refresh…
0
votes
1 answer

Cannot convert value of type 'Binding<_>' to expected argument type 'Binding'

I am trying to create a binding to a FetchedResults item, error is on $items[i]: struct NavView: View { @Binding var item : Card ... } struct ContentView: View { private var items: FetchedResults var body: some View { List { …
0
votes
1 answer

SwiftUI Dismiss keyboard on List NavigationLink item tap

I have a list of items and a text field for search keywords. When I do search on the list and tap on items, navigationlink works faster than keyboard dismiss, and this causes a disabled area in the next scroll view. // search TextField HStack { …
0
votes
1 answer

SwiftUI NavigationView detail view not shown

The following NavigationView contains a primary master and secondary detail view: struct ContentView: View { var body: some View { NavigationView { Text("Primary View") .navigationTitle("Primary") …
sbooth
  • 16,646
  • 2
  • 55
  • 81
0
votes
1 answer

Rotation Effect not working as expected inside a navigation view, but works as expected in any other view that is not in navigation view

I want to add a shape to rotate around its axis and use it to create a background. In order to do this, I created a background view and decided to use that view on all my screens. It seems that when I add the background view inside the navigation…
0
votes
1 answer

Swipe back when using a custom navigation bar and a TabView SwiftUI

I have a SwiftUI app which uses a custom navigation bar. Because of that, I need to handle the back navigation separately (both the back button and the swipe gesture). Everything went fine up until now, when I need to use a TabView to swipe between…
0
votes
0 answers

How to navigate in a Animated Custom Tab Bar / SwiftUI

I have created with help from another tutorial a Custom tab Bar with animation for my Example App to test the Project etc.. and now I want to add the navigation for each Icon(symbol) so when the user presses TapBarButton 1(Symbol"house") they see…
0
votes
2 answers

SwiftUI: Involuntary navigation of NavigationLink

I have a list of items. When I click an item Show Alert I am showing an alert which displays two options: either Navigate to dismiss the alert and navigate to the detail view or Cancel which is supposed to just dismiss the alert. The problem is that…
Isaak
  • 1,107
  • 2
  • 11
  • 29
0
votes
0 answers

GMSMarker click event in SwiftUI

I have used makeUiView() and updateUiView() methods in a UiViewRepresentable struct to create my mapview. struct GoogleMapView: UIViewRepresentable { func updateUIView(_ uiView: GMSMapView, context: Context) { let marker : GMSMarker =…
Santanu
  • 337
  • 1
  • 3
  • 13
0
votes
1 answer

Page View + Hidden Navigation Bar doesn't work

When I include a Page View as written by Apple in a Navigation View with a hidden Navigation Bar Title, swiping the page makes the title appear. struct ContentView: View { var body: some View { NavigationView { PageView(pages:…
AlexMath
  • 567
  • 1
  • 6
  • 16
0
votes
2 answers

How to set the background color of a List in a NavigationView

Consider a NavigationView containing a List of items. How does one give this a background color? Putting the NavigationView in a ZStack - doesn't work Putting the ZStack in the NavigationView (code sample below) - doesn't work struct test: View { …
Arjan
  • 16,210
  • 5
  • 30
  • 40