在我的应用程序中,我通过单击视图控制器中的一个按钮将我的应用程序制作为 tabbarcontroller 我想在第三个 tabbar 按钮的位置添加一个 UIButton,该怎么做?我已经按照这个教程(可能是最好的) - 但没有得到一个想法
我正在创建这样的标签栏
在 ViewController.h
@property (strong,nonatomic) IBOutlet UIViewController *myhomeVC,*groupVC,*uploadVC;
@property (nonatomic,strong) NSMutableArray *Array;
@property (strong,nonatomic) IBOutlet UINavigationController *homeNavBar,*groupNavBar,*uploadNavBar;
在 ViewController.m 中
-(IBAction)Login:(id)sender{
Array = [[NSMutableArray alloc] initWithCapacity:5];
myhomeVC = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
homeNavBar=[[UINavigationController alloc]initWithRootViewController:myhomeVC];
homeNavBar.tabBarItem.title=@"First";
groupVC = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
groupNavBar=[[UINavigationController alloc]initWithRootViewController:groupVC];
groupNavBar.tabBarItem.title=@"Second";
uploadVC = [[ThirdViewController alloc] initWithNibName:@"ThirdViewController" bundle:nil];
uploadNavBar=[[UINavigationController alloc]initWithRootViewController:uploadVC];
uploadNavBar.tabBarItem.title=@"Third";
[Array addObject:homeNavBar];
[Array addObject:groupNavBar];
[Array addObject:uploadNavBar];
appDelegate.tabBarController.viewControllers = localViewControllersArray;
[self.parentViewController.view setHidden:YES];
appDelegate.window.rootViewController = appDelegate.tabBarController;
}
}