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

Programmatic navigation with NavigationView/NavigationLink delay jumps back

I created a simple showcase where my problem can be reproduced; what I'm doing is navigating from the initial view => View1 => View2. The navigation from the initial to View1 happens via button tap, nothing special here. My View1 looks the…
swalkner
  • 16,679
  • 31
  • 123
  • 210
6
votes
0 answers

SwiftUI NavigationView issue with Parent-Child-Grandchild scenario when attempting grandchild previous next navigation

I am using SwiftUI in a project that requires a model with a 'one to many to many' entity structure. I use a navigation view at the parent level with navigation links at parent and child levels. This works well in that I can: Select a child at…
6
votes
2 answers

SwiftUI NavigationView remove white space

I have a HomeView NavigationView { ZStack { VStack { NavigationLink(destination: ProfileView()) { if session.userInSession?.activated != 1 { completionText(message: "Complete Your…
5
votes
2 answers

Blur effect on SwiftUI NavigationBar stops working if I add content to the bottom of my view

I have a very simple View with NavigationBar and a List in a VStack. If I scroll up on the list, the list contents will appear behind the NavigationBar with a nice blur effect by default. This behavior is correct. The correct blur effect I would…
Falco
  • 63
  • 5
5
votes
2 answers

SwiftUI hidesBottomBarWhenPushed equivalent?

I'm trying to hide my TabView when I push a new view in my NavigationView but for now it seems that there is no way to do it (I saw a lot of thing on Internet, but nothing seems work properly for me)? By default my code look like this: struct…
5
votes
1 answer

Scroll View Items Come Over the Navigation Bar in SwiftUI

I am new to SwiftUI. I made a custom nav bar. and added a scroll view below it. The problem I am getting is when I scroll down, the data inside scroll view comes over the navigation bar. Here is the screenshot: My code is: struct NewsfeedView: View…
5
votes
3 answers

SwiftUI - Navigation bar back button appears for a fraction of second

I have looked into many solutions but none of them works. My app navigation flow is ViewController (UIKit) - pushes to SwiftUI view This SwiftUI view shows the back bar button for a fraction of seconds and then gets hidden. Here is my code: struct…
Bhuvan Bhatt
  • 3,276
  • 2
  • 18
  • 23
5
votes
2 answers

Create a common layout for the navigation bar in SwiftUI, so other SwiftUI views should reuse same Nav Bar

In iOS SwiftUI, how can we make a common layout for the navigation bar, so we can use that in all projects without rewriting the same code? We can use ViewBuilder to create a base view for common code as follows: struct BaseView:…
GrayFox
  • 101
  • 1
  • 9
5
votes
1 answer

NavigationLink keeps aligning my text elements to center instead of leading SwiftUI

I have a CustomSearchBar view that looks like this However, when I wrap it with NavigationLink, the placeholder text will be centered. And user inputs will be centered too. How do I maintain the leading alignment while using NavigationLink? My…
5
votes
2 answers

How to show in SwiftUI the sidebar in iPad and portrait mode

I have an master detail app in iPad, and when run the app in portrait mode the sidebar is hidden. I need to push Back button to open the sidebar. Can anyone help me to show the sidebar by default? I found an answer that suggest to use…
5
votes
0 answers

SwiftUI toolbar covered by keyboard accessory view

Hi there I have a tricky problem to solve with SwiftUI in Xcode 12.4 (iOS 14): given I have a Form with numerous sections and TextEditors, this form having a .toolbar modifier (bottom bar) with some content (button in this case). All of it is…
5
votes
1 answer

In SwiftUI, how can I avoid redrawing a parent view while updating shared state data from a child view to avoid Navigation issues?

Since Xcode 12.5, I am seeing a lot of "Unable to present. Please file a bug." console logs in the Xcode console which I remember not seeing prior to 12.5. This message is shown when I am using NavigationLink from a parent view to navigate to a…
user482594
  • 16,878
  • 21
  • 72
  • 108
4
votes
1 answer

Navigation bug when dismissing view while focussing on empty .searchable() modifier

When trying to navigate back from a view using the environment Dismiss value while also focussing on an empty searchable modifier the view you navigated back to becomes unresponsive. This is due to an empty UIView blocking any interaction with the…
4
votes
0 answers

iOS: List selection is reset to nil when app is sent to background

For some reason, a List will reset its selection to nil when the app is in the background. Steps to reproduce the issue: Run attached sample project Once the app has launched, select a name in the sidebar Move the app to the background Wait a few…
GSD
  • 149
  • 6
4
votes
0 answers

Change size of Navigation Bar in SwiftUI

Hello SO community I'm trying to recreate NavigationBar from Contact tab Apple's Phone in my SwiftUI app. I played around with .toolbar and modifications but really can't recreate it. I wanna replace TextField to SegmentPicker with saving all…
Nizami
  • 728
  • 1
  • 6
  • 24
1 2
3
38 39