![](/img/trans.png)
[英]Lottie animation disappears on last TabView page in SwiftUI
[英]SwiftUI animation tabs of a TabView
在 SwiftUI 中使用 TabView 时,是否可以修改选项卡选择之间的转换? Currently, when different tabs are selected, the transition is pretty sudden; 居然瞬间突然,哎哟。
例如,给定以下内容:
TabView {
Text("The First Tab")
.tabItem {
Image(systemName: "1.square.fill")
Text("First")
}
Text("Another Tab")
.tabItem {
Image(systemName: "2.square.fill")
Text("Second")
}
Text("The Last Tab")
.tabItem {
Image(systemName: "3.square.fill")
Text("Third")
}
}
如何添加类似 .transition(AnyTransition.opacity.combined(with: .slide)) 的东西
谢谢 !
您可以将 .animation 属性添加到您的 TabView。
TabView {
// code here
}
.animation(*animation type*)
您拥有的基本动画类型是.default
、 .easeIn
、 .easeOut
、 .easeInOut
和.linear
。
希望这可以帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.