【问题标题】:UIButton on tabbar标签栏上的 UIButton
【发布时间】:2013-01-21 15:57:51
【问题描述】:

在我的应用程序中,我通过单击视图控制器中的按钮将我的应用程序制作为 tabbarcontroller 我想在第三个标签栏按钮的位置添加一个 UIButton,怎么做? 我已经关注this 教程(可能是最好的)-但没有得到一个想法

我正在创建这样的标签栏

在 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;


     }
     }

【问题讨论】:

    标签: ios objective-c uibutton uitabbarcontroller uitabbar


    【解决方案1】:
    猜你喜欢
    • 2014-12-08
    • 1970-01-01
    • 1970-01-01
    • 2019-01-08
    • 1970-01-01
    • 2021-01-09
    • 1970-01-01
    • 1970-01-01
    • 2012-09-27
    相关资源
    最近更新 更多