Jar*_*edH 7 swiftui swiftui-navigationlink
我试图NavigationLink从屏幕底部加载视图,而不是从右侧转换,但“明显”的方法(使用 a .transition(.move(edge: .bottom)))似乎没有任何效果。
下面是里面的NavigationView:
List {
ForEach(self.message, id: \.self) { message in
HStack(alignment: .center) {
MessageListCell(....)
}
}
}
Run Code Online (Sandbox Code Playgroud)
和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")
}
}
}
Run Code Online (Sandbox Code Playgroud)
NextButton从屏幕右侧而不是底部点击一致的过渡。我已经尝试过上述方法的变体,但我开始认为这transition可能不是正确的方法。
| 归档时间: |
|
| 查看次数: |
4914 次 |
| 最近记录: |