1

在我的应用程序中,我通过单击视图控制器中的一个按钮将我的应用程序制作为 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;


     }
     }
4

1 回答 1

2

你为什么不为你的项目选择 GTabBar。?GTabBar 的链接。, http://www.guerrillawebsitedesign.co.uk/wordpress/index.php/2010/09/30/how-to-create-a-custom-uitabbarcontroller-for-the-iphone-with -不同的背景图像和图标部分 1-2/

于 2013-01-24T06:07:39.930 回答