【发布时间】:2019-07-21 10:53:55
【问题描述】:
我正在尝试创建SwiftUI 自定义转场动画,像这样
我尝试将动画链接到Destination,但没有用,它只是在演示动画完成后在Destination 的内容中进行动画处理。
struct ContentView : View {
var body: some View {
NavigationView {
VStack {
List {
NavigationButton(destination: withAnimation{
Destination()
}.frame(width: 300, height: 300)
.animation(.basic())) {
CellView()
}
}
}
}
}
}
struct CellView : View {
var body: some View {
VStack {
Text("Cell")
}
}
}
struct Destination : View {
var body: some View {
VStack {
Text("GFD")
}
}
}
【问题讨论】:
标签: ios swift uistoryboardsegue swiftui