问题
Please see the link below.
http://itunes.apple.com/app/id383298204?mt=8
There are screen shots of showpick application. In that there is a collect button which is some what impossible to implement under ui tab bar. Can someone help me to figure it out how they have implemented it? Is that an actual UITabBar?
Thank you
回答1:
I figured out a workaround. I basically add a dummy controller for the middle entry of the UITabBarController. And in viewDidLoad I add a button to the UITabBar like so:
tabBarButton = [[UIButton alloc]initWithFrame:CGRectMake(125, -10, 70, 33)];
[tabBarButton setBackgroundImage:[UIImage imageNamed:@"state-inactive"]forState:tabBarButton];
[topbarButtonScan setBackgroundImage:[UIImage imageNamed:@"state-active"]forState:UIControlEventTouchDown];
[tabBarButton addTarget:self action:@selector(tabBarButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
[[[self tabBarController]tabBar ] addSubview: tabBarButton];
来源:https://stackoverflow.com/questions/4192784/shopkick-application-ui-widgets