navigationview

Mapview shows White overlay on Interaction

吃可爱长大的小学妹 提交于 2021-02-10 05:46:09
问题 I am using GMSMapView with SwiftUI, in map-view I have to display some markers with lat and long. Upon clicking any marker I have to Move to another view. I am doing this by putting MapView in NavigationLink . This thing is working fine By using code. NavigationView { NavigationLink(destination: Text(""), isActive: $abc) { MapView().edgesIgnoringSafeArea(.all) } } And the issue is NavigationLink , after putting mapview in NavigationLink every-time when i interact with map, white overlay

How to properly include “Add Item” button in a NavigationView using SwiftUI?

为君一笑 提交于 2021-02-09 09:25:09
问题 I need a "Plus" ⊕ Button in my NavigationView 's List .navigationBarItems (right on the navigation bar), which I'd like to add a row to the list, using a subsequent view in the navigation hierarchy to enter its name etc. But first, I can't even get the button to navigate correctly! When I tap it in the Preview Canvas, the button's operation seems to work. Yet in an actual app, while it does navigate to my destination View, when I tap that View's "< Back" button, the app crashes with:

How to properly include “Add Item” button in a NavigationView using SwiftUI?

寵の児 提交于 2021-02-09 09:23:06
问题 I need a "Plus" ⊕ Button in my NavigationView 's List .navigationBarItems (right on the navigation bar), which I'd like to add a row to the list, using a subsequent view in the navigation hierarchy to enter its name etc. But first, I can't even get the button to navigate correctly! When I tap it in the Preview Canvas, the button's operation seems to work. Yet in an actual app, while it does navigate to my destination View, when I tap that View's "< Back" button, the app crashes with:

Is there a SwiftUI equivalent for viewWillDisappear(_:) or detect when a view is about to be removed?

喜夏-厌秋 提交于 2021-02-04 13:03:53
问题 In SwiftUI, I'm trying to find a way to detect that a view is about to be removed only when using the default navigationBackButton . Then perform some action. Using onDisappear(perform:) acts like viewDidDisappear(_:) , and the action performs after another view appears. Or, I was thinking the above problem might be solved by detecting when the default navigationBarBackButton is pressed. But I've found no way to detect that. Is there any solution to perform some action before another view

SwiftUI hiding a navigation bar only when looking at ContentView

我是研究僧i 提交于 2021-01-29 20:19:34
问题 I have a Content file and am hiding the navigation bar because it takes up space and pushes elements down. One of the buttons in the ContentView redirects (using a navigation link) to another view. In this other view, the navigationBar is still hidden....for simplicity sake, I'll cut out some of the code from ContentView: //this is the view that looks "fine" (i.e. the navigation bar takes up no space) struct ContentView: View { @State private var isPresentedSettings = false var body: some

SwiftUI hiding a navigation bar only when looking at ContentView

蓝咒 提交于 2021-01-29 16:44:02
问题 I have a Content file and am hiding the navigation bar because it takes up space and pushes elements down. One of the buttons in the ContentView redirects (using a navigation link) to another view. In this other view, the navigationBar is still hidden....for simplicity sake, I'll cut out some of the code from ContentView: //this is the view that looks "fine" (i.e. the navigation bar takes up no space) struct ContentView: View { @State private var isPresentedSettings = false var body: some

How can I programmatically open (show in screen) NavigationView

梦想与她 提交于 2021-01-22 00:27:50
问题 How can I programmatically open (show in screen) NavigationView? I can't find any function what can be helpfull. I have this xml file: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> //... <android.support

How can I programmatically open (show in screen) NavigationView

僤鯓⒐⒋嵵緔 提交于 2021-01-22 00:27:50
问题 How can I programmatically open (show in screen) NavigationView? I can't find any function what can be helpfull. I have this xml file: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> //... <android.support

How can I programmatically open (show in screen) NavigationView

左心房为你撑大大i 提交于 2021-01-22 00:27:33
问题 How can I programmatically open (show in screen) NavigationView? I can't find any function what can be helpfull. I have this xml file: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> //... <android.support

How to remove opacity animation in SwiftUI NavigationLink

烂漫一生 提交于 2021-01-06 04:48:25
问题 When tapping on a NavigationLink, it reduces the opacity slightly. Is there a way to disable this. I tried using .buttonStyle(PlainButtonStyle()) but that didn't have the desired effect. It is embedded in a scrollView (preferred over List for customizability): ScrollView { ForEach(items){ item in NavigationLink(destination: DetailView()){ HStack{ Text("title") Spacer() Image(systemName: "chevron.right") } .padding() .background( RoundedRectangle(cornerRadius: 10, style: continuous)