2

How do you display a background color for the selected tab view? I know that you can tint it when it's selected, however, I don't think this is of much use if you can not change the background color.

Also, how do you add a divider for each tab?

Thanks in advance

goo
  • 2,230
  • 4
  • 32
  • 53

1 Answers1

0

Set an image as the background for the selection:

tabBarController.tabBar.selectionIndicatorImage = [UIImage imageNamed:@"image.png"];

As for the dividers, prior to iOS 7 you could simulate them by adding an image for the selected state and another for the unselected state for each tab. See more here. Those methods were deprecated in iOS 7, though.

Community
  • 1
  • 1
Guto Araujo
  • 3,824
  • 2
  • 21
  • 26