EDIT: It seems like after all this solution should work, I am having problems with the cache
UIImage *selTab = [[UIImage imageNamed:@"tabHighlight"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; CGSize tabSize = CGSizeMake(CGRectGetWidth(self.view.frame)/5, 49); UIGraphicsBeginImageContext(tabSize); [selTab drawInRect:CGRectMake(0, 0, tabSize.width, tabSize.height)]; UIImage *reSizeImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext();
tabHiglight is tabHiglight png, I tested other sizes, but this seems to be the best fit. I divide the width frame by the number of elements that I have on the tabBar - in my case 5, then I create a new UIImage from the "correct" size and set it as selectionIndicatorImage .
tagyro
source share