Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 7 tabBar-line, how to remove it?

Apple has added a tiny line over the tabBar in iOS 7 which is supposed to work as a shadow or fade between the tabBar and the UI

enter image description here

Since I am using a custom-made tabBar the line is quite irritating. How do you remove it? Please tell me it is possible, otherwise I need to redesign my whole app lol....

/ Regards

*Edit

Sloved my problem with the following line of code:

[[UITabBar appearance] setShadowImage:[[UIImage alloc] init]];
like image 771
Jesper Martensson Avatar asked Sep 22 '13 00:09

Jesper Martensson


2 Answers

    UIImage* tabBarBackground = [UIImage imageNamed:@"tabbar_bg.png"];
    [[UITabBar appearance] setShadowImage:tabBarBackground];
    [[UITabBar appearance] setBackgroundImage:tabBarBackground];   
like image 149
liancheng.jiang Avatar answered Nov 06 '22 02:11

liancheng.jiang


These code works pretty well for me (I don't really have background image for tab bar):

[tab_main.tabBar setBackgroundImage:[[UIImage alloc] init]];
[[UITabBar appearance] setShadowImage:[[UIImage alloc] init]];

And I use these code to add a frame too:

UIColor* color_green = UIColorFromRGB(0x348e5b);
tab_main.tabBar.layer.borderWidth = 0.50;
tab_main.tabBar.layer.borderColor = color_green.CGColor;
[[UITabBar appearance] setTintColor:color_green];

Hope that helps.

like image 14
superarts.org Avatar answered Nov 06 '22 02:11

superarts.org