4

In iOS 7 Apple increased the standard size of tab bar icons. If the tab bar icons are set in a storyboard, how can you support both iOS 6 and iOS 7 interfaces simultaneously? Do you have to make a separate storyboard for iOS 7?

Programmatically adjust the icon if you're in iOS 7?

I'm mostly confused because the documentation doesn't seem to mention anything about differently sized icons for tab bars (https://developer.apple.com/library/ios/documentation/userexperience/conceptual/TransitionGuide/TransitionGuide.pdf page 26)

In fact the icons look almost identical.

But when I run my app in iOS 7 all the icons appear shrunk down.

shim
  • 9,289
  • 12
  • 69
  • 108
  • Hi even I have seen custom tabbar icons like https://github.com/boctor/idev-recipes/blob/master/RaisedCenterTabBar/Images/Instagram/cameraTabBarItem@2x.png?raw=true in IOS7 shrinking where as works perfectly below ios7.Did u get any solution for it? – Alphonse R. Dsouza Dec 10 '13 at 08:27
  • You don't necessarily want to use the same icon file for two different resolutions. Shrinking down a high resolution image doesn't always work perfectly. – shim Dec 11 '13 at 05:52

2 Answers2

0

You can use following method to check the version of current iOS and then customize the button size and appearance of the navigation bar buttons.

 if (floor(NSFoundationVersionNumber)<=NSFoundationVersionNumber_iOS_6_1) {
        UIImage *navBarImage=[[UIImage imageNamed:@"top-bar-bg-44px.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
        [[UINavigationBar appearance] setBackgroundImage:navBarImage forBarMetrics:UIBarMetricsDefault];

        UIImage *barButtonImg=[[UIImage imageNamed:@"back-ios6.png"]
            resizableImageWithCapInsets:UIEdgeInsetsMake(0, 13, 0, 5)];

        [[UIBarButtonItem appearance] setBackButtonBackgroundImage:barButtonImg forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
    }

    else{


}
shim
  • 9,289
  • 12
  • 69
  • 108
Shabir jan
  • 2,295
  • 2
  • 23
  • 37
0

After some digging, I found the answer over here - Tab bar icons on retina display

"You need to create two separate icons icon.png (30x30) and icon@2x.png (60x60). iOS will automatically load the right file based on the screen scale."

Community
  • 1
  • 1
Mike Dorsey
  • 171
  • 2
  • 5
  • This does not answer the question, which is about the difference in size between iOS6 and iOS7 icons, not about the difference between non-retina and retina displays. – fishinear Dec 03 '14 at 01:42