0

I've been attempting to customise the background colour of the active tab, via this post. It works pretty well, but I get a very odd 1px line on each of the tabs when they're selected - this only occurs when I start the app in portrait mode and then turn it landscape.

Am I missing something?

enter image description here

Community
  • 1
  • 1
Ben
  • 4,707
  • 5
  • 34
  • 55

1 Answers1

0

I ended up fixing this by adjusting the selectionIndicatorImage code, to generate an image that was 2x as wide as the current tab. I realise this probably isn't the best solution, so if anybody has a better one please do let me know!

The line of code:

let tabBarItemSize = CGSize(width: (tabBar.frame.width*2) / numberOfItems, height: tabBar.frame.height)
Ben
  • 4,707
  • 5
  • 34
  • 55