Post

Replies

Boosts

Views

Activity

Reply to How to replace tabBar with bottomBar with smooth animation in SwiftUI?
@DTS Engineer Thank you for the example. In my app, TabView is the root view, and NavigationStack is nested within each Tab. I changed the provided example to match the structure of my app, and found that the animation issue was still present. Is this expected behavior? struct ContentView: View { @State private var isEditing = false var body: some View { TabView { Tab("Received", systemImage: "tray.and.arrow.down.fill") { NavigationStack { Button("toogle") { isEditing.toggle() } .toolbar(isEditing ? .hidden : .visible, for: .tabBar) .toolbar(isEditing ? .visible : .hidden, for: .bottomBar) .animation(.easeIn, value: isEditing) .toolbar { ToolbarItem(placement: .bottomBar) { Text("hello world") } } } } .badge(2) Tab("Sent", systemImage: "tray.and.arrow.up.fill") { Color.blue } Tab("Account", systemImage: "person.crop.circle.fill") { Color.green } .badge("!") } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’24