Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I found another way! #5

Open
woozoobro opened this issue May 19, 2023 · 2 comments
Open

I found another way! #5

woozoobro opened this issue May 19, 2023 · 2 comments

Comments

@woozoobro
Copy link

TabBarCustom

There's a .toolbar(.hidden, for: .tabBar) modifier.

Put this modifier in the destination View.

And then

In the ContentView

struct ContentView: View {
    @State private var selection: Int = 0
    
    var body: some View {

        TabView(selection: $selection) {
            HomeView()
            .tabItem {
                Image(systemName: "house")
            }
            .toolbarBackground(.visible, for: .tabBar)
            .tag(0)
            
            NavigationStack {
                ForumView()
            }
            .tabItem {
                Image(systemName: "text.bubble")
            }
            .toolbarBackground(.visible, for: .tabBar)
            .tag(1)
            
            NavigationStack {
                ProjectsView()
            }
            .tabItem {
                Image(systemName: "folder.fill")
            }
            .toolbarBackground(.visible, for: .tabBar)
            .tag(2)

            LoginRootView()
            .tabItem {
                Image(systemName: "person.crop.circle")
            }
            .toolbarBackground(.visible, for: .tabBar)
            .tag(3)
        }
        .tint(Color.orange)
        .animation(.spring(response: 0.3, dampingFraction: 0.6), value: selection)
        .toolbar(.visible, for: .tabBar)        
    }

.animation(.spring(response: 0.3, dampingFraction: 0.6), value: selection)

Put this animation in the TabView's selection property

@TreatTrick
Copy link
Owner

TreatTrick commented Jul 2, 2023

Thanks very much for giving this important feedback to this project. I am sorry because I have not focused on iOS development for years and didn't reply your last question immediately.

@cairongquan
Copy link

hi,is support ios15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants