2

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

4

2 回答 2

0

此链接可能对您有所帮助:

http://howtomakeiphoneapps.com/how-can-i-add-tabs-programmatically-to-uitabbar/201/

http://kurrytran.blogspot.in/2011/10/ios-5-tutorial-creating-custom-tab-bar.html

http://mobiledevelopertips.com/open-source/ios-open-source-custom-tabbar-controller-bctabbarcontroller.html

或者

另一个选项是 - 您可以使用类似于 UITabbarController 的自定义按钮。

享受编码:)

穆纳尔

于 2012-08-10T06:40:36.620 回答
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;
}
于 2012-08-10T07:35:14.777 回答