5

I have a UITabBar with 3 bars in my application. What I am trying to do is implementing a custom selectionIndicatorImage. Everything is fine except for the last bar where I get a weird 1 pt padding to the right.

Example

UITabBar

Code

[[UITabBar appearance] setBackgroundImage:[UIImage imageNamed:@"tabbar-test.png"]];
[[UITabBar appearance] setSelectionIndicatorImage:[UIImage imageNamed:@"tabbar-selected.png"]];

Dimensions

tabbar-test.png 320x49 and 640x98

tabbar-selected.png 107x49 and 214x98

Daniel Tovesson
  • 2,550
  • 1
  • 30
  • 41
  • check the answer of this question: http://stackoverflow.com/questions/10035302/uitabbar-selectionindicatorimage-padding – CarmeloS Aug 18 '15 at 11:56

1 Answers1

0

Here are some questions similar to yours:

How do I remove UITabBarItem selectionImage padding?

UITabBar selectionIndicatorImage padding

I met this issue and did not find a nice solution. At last, I use a 3rd part controller:

https://github.com/robbdimitrov/RDVTabBarController

Community
  • 1
  • 1
Harrison Xi
  • 766
  • 1
  • 5
  • 23