swift - swift ui 导航栏后退按钮仅被隐藏它正在占用空间和多个后退按钮占用空间询问我导航到其他页面
问题描述
NavigationLink("", destination: login(),isActive: $goWhenTrue)
Button (action: { print("Button Tapped")}, label: {
Text("LogOut")
.font(.headline)
.foregroundColor(.white)
.frame(width: 340, height: 50)
.background(Color.blue)
.clipShape(Capsule())
.padding()
.onTapGesture {
self.goWhenTrue = true
UserDefaults.standard.removeObject(forKey:"Username")
}
})
.shadow(color: .gray, radius: 15, x: 0.0, y: 0.0)
Spacer()
}.padding(.bottom)
.navigationBarTitle(Text("Welcome Home"), displayMode: .automatic)
.navigationBarBackButtonHidden(true)
在这个 swift UI 程序中,我试图从每个页面中消除后退按钮,但我只能将其隐藏,然后它也会占用空间。我想在移动到登录页面时删除间距,后退按钮将登录页面向下推需要确保不会发生任何人都可以帮助我吗?
解决方案
推荐阅读
- c# - Interlocked.Increment *with* [ThreadStatic]?
- c# - 从 C# 到 MySQL 实例的 SSH 和 sudo 连接
- vue.js - 如何使用 @vue/composition-api 和 nuxt.js 获取 vue-apollo 实例
- javascript - 当 Babel 和 Traceur 转译 ES6 解构时,额外变量的目的是什么?
- excel - VBA超链接:如何选择目标单元格的行并将其置于屏幕中心
- linux - 从 bash 脚本安装 nginx 模块不起作用
- java - 在 swagger 中关闭外部引用模型的生成
- javascript - 计时器不倒计时
- visual-studio - 如何在 Visual Studio 项目中使用 GNU 软件?
- graphql - Apollo Federation:Federation 是否取代了 delegateToSchema?