2012-08-10 45 views
2

我尝试为iPhone创建框架并尝试在我的框架中实现自定义Tabbar控制器。任何人都可以帮助我为iPhone创建自定义标签栏控制器。我的意思是编程添加标签栏控制器。用于iPhone的自定义Tabbar控制器

+0

ü要做些什么,如何添加TabbarController编程(OR)customTabBar? – Manikandan 2012-08-10 06:40:48

+0

有很多tabbar的框架。尝试看看http://cocoacontrols.com/。 – HelmiB 2012-08-10 06:40:49

+0

你打算创建框架!? – 2012-08-10 07:23:40

回答

0
To create tab bar give this code in AppDelegate.m 

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    UIViewController *viewController1, *viewController2,*viewController3; 

    viewController1 = [[FirstViewController alloc] initWithNibName:@"FirstViewControllerXibname" bundle:nil]; 
    viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewControllerXibname" bundle:nil]; 
    viewController3 = [[ThirdViewController alloc] initWithNibName:@"ThirdViewControllerXibname" bundle:nil]; 


    self.tabBarController = [[UITabBarController alloc] init]; 
    self.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2,viewController3, nil]; 
    self.window.rootViewController = self.tabBarController; 
    [self.window makeKeyAndVisible]; 


    self.tabBarController.moreNavigationController.navigationBar.tintColor =[UIColor darkTextColor]; 

    [[UITabBar appearance] setSelectedImageTintColor:[UIColor yellowColor]]; //change selected image color on tabbatItem 

    self.tabBarController.moreNavigationController.navigationBar.barStyle = UIBarStyleBlackOpaque; 

    [self.tabBarController.tabBar setOpaque:YES]; 
    return YES; 
}