I'm trying to use a custom icon in a SwiftUI TabView. I can't see what's wrong with this code – I've included resizable
on the image, yet it does not scale down.
HomeView()
.tag(0)
.tabItem {
VStack {
Image("tab-home")
.resizable()
.aspectRatio(CGSize(width: 20, height: 20), contentMode: .fit)
Text("Home")
}
}
When I view this, the image is full size.
It works fine when the Image
is an SF Symbol.
Any ideas, SwiftUI ninjas?