0

I want to set the users Profile Picture as the item Image of the Tabbar. What I tried so far is following:

                 ProfileView()
                     .tag(3)
                     .tabItem {

                        if selectedTab == 3 {
                            Image("1024")
                                .resizable()
                                .scaledToFit()
                                .frame(width: 20.0, height: 20.0)
                        } else {
                            Image(systemName: "bell")
                        }
                       }

It also shows the Image, but way to big - it doesn't resize to the 20x20... Am I missing something? .renderingMode(.template) doesn't help as well

  • 1
    Does this answer your question? [Image not resizing in SwiftUI TabView](https://stackoverflow.com/questions/58450061/image-not-resizing-in-swiftui-tabview). Basically, you just need to create a scaled-down version of their profile picture and use that. – George Aug 18 '21 at 08:59
  • Oh ok... yeah I Saw that but thought there might be a workaround haha - thank you though – SwiftyJason Aug 18 '21 at 09:17
  • Unfortunately not, sorry. Usually if something isn't possible in UIKit, it's probably not possible in SwiftUI since SwiftUI is basically UIKit under the hood. – George Aug 18 '21 at 09:34

0 Answers0