我刚开始学习SwiftUI,我必须在SwiftUI中管理以下导航堆栈,
Here is my first entry of the app :-个
import SwiftUI
@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
Landing()
}
}
}
here is the Landing Page :-个
struct Landing: View {
var body: some View {
NavigationStack {
HStack(spacing: 13) {
NavigationLink {
Login()
} label: {
DetezoMainNavigationBtn(title: LandingScreenTexts.logIn)
}
}
}
}
}
here is my Login Page :-个
struct Login: View {
@State var isSignInClicked = false
var body: some View {
NavigationStack {
DetezoMainButton(title: LoginScreenTexts.logIn, acttion: {
isSignInClicked = true
})
}
.navigationDestination(isPresented: $isSignInClicked, destination: {
MyZone()
})
}
}
好吧,这里是我的最低要求是当我点击登录从着陆页,然后滑动到后面的手势和导航回来应该工作. 但是,当我点击登录页面上的登录按钮,然后滑动到后面的手势和导航回来不应该工作.和导航堆栈应重置和我的区域页面应该是导航堆栈的新父