1

I would like to highlight a selected UITabBarItem by adding a 2 point border with colour to the top of it. I thought it would be a simple case of looping using add sub view but you can't gain access to the view of the UITabBarItem. Could someone please point me in the right direction?

Pranjal Bikash Das
  • 1,092
  • 9
  • 27
ORStudios
  • 3,157
  • 9
  • 41
  • 69
  • Can you instead using of icon image? if you go with icon image then use following this code. [self.tabBarItem setFinishedSelectedImage:[UIImage imageNamed:@"NormalImage"] withFinishedUnselectedImage:[UIImage imageNamed:@"BorderImage"]]; – BuLB JoBs Oct 31 '17 at 12:38
  • You can use two different image for tab bar for selected state and normal state like https://stackoverflow.com/a/26802597/4601900 – Prashant Tukadiya Oct 31 '17 at 12:40
  • I think you need this https://stackoverflow.com/q/32668812/4601900 – Prashant Tukadiya Oct 31 '17 at 12:41
  • This answer looks like it could do the job for you. It's using Swift, but easy to convert to Obj-C. And, it's drawing the line on the bottom, but again, easy to convert to the top: https://stackoverflow.com/a/33670450/6257435 – DonMag Oct 31 '17 at 12:41

0 Answers0