Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increase size of tab bar item icons in SwiftUI

Is there a way to increase the size of tab bar item icons?
.frame(width: 40, height: 40) doesn't help.

Settings()
    .tabItem {
        VStack {
            Image(systemName: "archivebox")
        }
    }
    .tag(1)
like image 808
arakweker Avatar asked Sep 03 '19 21:09

arakweker


People also ask

How do I change the tab bar color in Swiftui?

To change the background color and default tab item colors, some extra work is required as demonstrated below. As shown in lines 2-4, we can use UITabBar. appearance(). backgroundColor to modify the color of the tab bar.


1 Answers

You can directly use font size like that (tested in Xcode 11.3).

Please note that only works for symbol images (SF Symbols or . custom SVG symbols), it doesn't work for bitmap images.

YourView()
   .tabItem { 
      Image(systemName: "heart").font(.system(size: 26)) 
      Text("Offers") 
   }
like image 189
ali6p Avatar answered Oct 20 '22 14:10

ali6p