Increase size of TabBar?

44 Views Asked by At

I am trying to create a tabBar with a background image, but it appears that its not big enough. It appears that the image background or doesnt start from the beggining or the background is not big enough.

How can I increase the size of it?

enter image description here

I want to achieve this:

enter image description here

This is the code:

init() {
    let appearance = UITabBarAppearance()
    appearance.configureWithOpaqueBackground()
    appearance.backgroundImage = UIImage(named: "tabBarBackground")
    UITabBar.appearance().scrollEdgeAppearance = appearance
}

var body: some View {
    ZStack(alignment: .bottom) {
        VStack {
            TabView {
                ZStack {
                    Color.green
                        .opacity(0.1)
                        .ignoresSafeArea()
                    
                    VStack {
                        dashboardView
                        
                    }
                    .font(.title2)
                }
                
                .tabItem {
                    Image("home-selected-ic")
                }
                assetsView
                    .tabItem {
                        Image("assets-unselected-ic")
                    }
                chatView
                    .tabItem {
                        Image("chat-unselected-ic")
                    }
                dAppsView
                    .tabItem {
                        Image("apps-unselected-ic")
                    }
                assetsView
                    .tabItem {
                        Image("wiz-unselected-ic")
                    }
            }
        }
    }
}
0

There are 0 best solutions below