swiftui - NavigationView / NavigationLink 自定义过渡方向
问题描述
我试图NavigationLink
从屏幕底部加载视图,而不是从右侧过渡,但“明显”的方法(使用 a .transition(.move(edge: .bottom))
)似乎没有任何效果。
下面是里面的NavigationView
:
List {
ForEach(self.message, id: \.self) { message in
HStack(alignment: .center) {
MessageListCell(....)
}
}
}
和MessageListCell
:
var body: some View {
HStack {
VStack(alignment: .leading, spacing: 0) {
Text(person.firstName).lineLimit(1)
.foregroundColor(.main)
}
Spacer()
NavigationLink(destination: MessageDetail(otherPerson: otherPerson,
subject: subject,
profileHandler: { ProfileReducer($0) })
.transition(.move(edge: .bottom)),
tag: 1, selection: $action) {
NextButton("Proceed")
}
}
}
NextButton
从屏幕右侧而不是底部点击一致的过渡。我已经尝试过上述方法的变化,但我开始认为这transition
可能不是正确的方法。
解决方案
推荐阅读
- reactjs - 为子文件夹声明模块
- excel - 指定 Windows 用户名 tu 一次取消保护所有工作表
- javascript - 我的 php 变量没有得到 jquery 的值,为什么?
- r - R中的规范分析
- python-3.x - 如何在列表框py3中设置默认光标选择
- ubuntu - 如何为 hadoop 独立安装配置 ssh?
- java - 如何从firebase中的每个节点读取特定值?
- python - python中的l1=list和l2=list()声明不同吗?
- python - 使用 Peewee 选择一列
- unetstack - unetpy 中的 RxFrameNtf、TxFrameNtf 和 Ntf.data