我尝试为iPhone创建框架并尝试在我的框架中实现自定义Tabbar控制器。任何人都可以帮助我为iPhone创建自定义标签栏控制器。我的意思是编程添加标签栏控制器。用于iPhone的自定义Tabbar控制器
2
A
回答
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;
}
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
ü要做些什么,如何添加TabbarController编程(OR)customTabBar? – Manikandan 2012-08-10 06:40:48
有很多tabbar的框架。尝试看看http://cocoacontrols.com/。 – HelmiB 2012-08-10 06:40:49
你打算创建框架!? – 2012-08-10 07:23:40