0

I would like to have my tab bar similar to the App Store app (picture below). The active section has a coloured solid icon, and the other non-active sections will have the uncoloured outline icons. How can I switch from outline icon to solid icon depending on if it is selected or not? I would preferably want to accomplish this in interface builder but if thats not possible please explain how to do it in code. I have also provided a picture of my current tab bar. Notice how all of the icons are "outline" icons including the active section icon (I want the active section icon to be "solid"). I do have both the outline and solid icon sets, i'm just not sure how to use them both.

My current tab bar: My current tab bar

App Store tab bar (what I want but with my color not blue): enter image description here

Rob
  • 415,655
  • 72
  • 787
  • 1,044
Jason Fel
  • 921
  • 4
  • 10
  • 29
  • Programmatically, you have `UITablBarItem` for which there is `init(title title:, image:, selectedImage:)`, which lets you specify both the selected image, as well as the unselected image. In IB, you can specify both the selected image and the unselected image. – Rob Jun 08 '16 at 06:30
  • Thank you Rob. Good to know how to do it in code too. – Jason Fel Jun 08 '16 at 07:25

1 Answers1

2

"You can use storyboard to set selected image of tabbar. I tried and it worked for me. Select the UITabbarItem and add a run-time attribute 'selectedImage', select Type as 'Image' and give the name of your image as its value."

iamge that shows how it's done

Had the same problem, answer from here: Setting Selected Image in Tab Bar Controller with Storyboard

Community
  • 1
  • 1
  • Thank you very much it worked. Sorry I can't up vote you I don't have enough reputation to but I marked this as the correct answer. – Jason Fel Jun 08 '16 at 07:12