我尝试为iPhone创建框架,并尝试在我的框架中实现自定义Tabbar控制器。任何人都可以帮我为iPhone创建自定义标签栏控制器。我的意思是以编程方式添加标签栏控制器。
答案 0 :(得分: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
或
另一个选项是 - 您可以使用自定义按钮,其作用类似于UITabbarController。
享受编码:)
Mrunal
答案 1 :(得分: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;
}