Hi, I have been trying for many hours to animate the transition between tabs on the TabView for my app in swiftUI. I have looked at many online resources but they are all outdated.
The main method I have tried is this:
@State private var selection: Tab = .home //tab variable from list of enums not shown
TabView(selection: $selection) {
// content
}
.accentColor(//Color) //Works just fine
.animation(.easeInOut(duration: 0.3), value: selection) //Does nothing on preview or simulator
.transition(.slide) //Does nothing on preview or simulator
I really want the animation to work as it would make the app exactly how I would want it.
Here is how it looks:
Instead of having smooth transition between each tab, its a jarring instantaneous change. I would like to know how to slide from one screen to the other (without using PageView, as that removes the tabview that I want at the bottom).
Thanks.
2
0
6.9k