This a a sample TabBar code:
struct TabBar: View{
@State var current = 0
var body: some View{
TabView(selection: $current) {
View0()
.tag(0)
.tabItem {
Image(systemName: "anySystemImageName")
Text("")
}
View1()
.tag(1)
.tabItem {
Image(systemName: "anySystemImageName")
Text("")
}
}
}
}
How do I change the font and size of icons/text? Have already tried .font(.system(size: 30, weight: .bold))
after Image(systemName: "Any") and after TabView
brace and none worked.
You can change the font of the tab bar like this:
However, I am not aware if you can change the image size. I think the icon in tab bar have a fixed size. Not sure if you can change them in
UIKIt
Edit: You can just pass any UIFont. If you want a different weight there is systemFont(ofSize: weight:) available like this