I have a Tabbar which is created by SwiftUI, but I use different images for different status of selected Tabbar(selected and unselected), how can I do that.
I tried to change image name in
TabView1().onAppear() {
tabImageName1 = "image1_active"
tabImageName2 = "image2"
tabImageName3 = "image3"
tabImageName4 = "image4"
}
seems this not worked, and I think it's not so elegant, how can I change the image rightly, do we have better ways to do thing like this?
1
0
6.2k