JayVDiyk JayVDiyk - 1 year ago 570
iOS Question

How do we create a bigger center UITabBar Item

I am wondering how do we create a bigger center UITabBar like the shot below? Its really beautiful!!!!

enter image description here

Answer Source

I recommend you taking a look at the following article. It explains how to customise a tab bar raising the main button.


UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(0.0, 0.0, buttonImage.size.width, buttonImage.size.height);
[button setBackgroundImage:buttonImage forState:UIControlStateNormal];
[button setBackgroundImage:highlightImage forState:UIControlStateHighlighted];

CGFloat heightDifference = buttonImage.size.height - self.tabBar.frame.size.height;
if (heightDifference < 0)
   button.center = self.tabBar.center;
 CGPoint center = self.tabBar.center;
 center.y = center.y - heightDifference/2.0;
 button.center = center;

[self.view addSubview:button];

Guide: http://idevrecipes.com/2010/12/16/raised-center-tab-bar-button/

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download