navigationlink

NavigationLink Works Only for Once

亡梦爱人 提交于 2019-12-30 03:03:39
问题 I was working on an application with login and after login there are categories listed. And under each category there are some items listed horizontally. The thing is after login, main page appears and everything is listed great. When you click on an item it goes to detailed screen but when you try to go back it just crashes. I found this flow Why does my SwiftUI app crash when navigating backwards after placing a `NavigationLink` inside of a `navigationBarItems` in a `NavigationView`? but i

SwiftUI NavigationLink Button is gray and untouchable

二次信任 提交于 2019-12-02 14:08:14
问题 I can not get a NavigationLink in SwiftUI. The button is visible, but unfortunately this is gray and can not be clicked. Here is the code: import SwiftUI import Combine struct ContentView: View { var body: some View { NavigationView{ NavigationLink(destination: Text("Detail for Test")) { Text("Test") }.navigationBarTitle("Select a user") } } } Does anyone know the problem? 回答1: It seems the problem is related to the fact that you have added the NavigationLink inside the NavigationView without

SwiftUI NavigationLink Button is gray and untouchable

 ̄綄美尐妖づ 提交于 2019-12-02 03:28:35
I can not get a NavigationLink in SwiftUI. The button is visible, but unfortunately this is gray and can not be clicked. Here is the code: import SwiftUI import Combine struct ContentView: View { var body: some View { NavigationView{ NavigationLink(destination: Text("Detail for Test")) { Text("Test") }.navigationBarTitle("Select a user") } } } Does anyone know the problem? It seems the problem is related to the fact that you have added the NavigationLink inside the NavigationView without defining a layout In fact, if you add a VStack , everything works correctly struct ContentView: View { var