iOS????UI??UITableBarController??????
???????????? ???????[ 2015/1/29 12:12:33 ] ????????iOS ???????
?????????????
????UITableBarController??UINavigationController?????UITabBarController????????????????????????????????????????л??????????????QQ??????????
??
????????UITableBarController?????
????1.??ò??裺
??????1???????UITabBarController
??????2??????UIWindow??rootViewController?UITabBarController
??????3????????????????????viewcontroller??
??????4???????????????UITabBarController
????2.???????
????????????????????Application??????б???
????YYAppDelegate.m???
????1//
????2//YYAppDelegate.m
????3//01-UITabBar?????????????
????4//
????5//Created by?????on 14-6-7.
????6//Copyright(c)2014??itcast.All rights reserved.
????7//
????8
????9#import"YYAppDelegate.h"
????10
????11@implementation YYAppDelegate
????12
????13-(BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
????14{
????15//1.????Window
????16 self.window=[[UIWindow alloc]initWithFrame:[[UIScreen mainScreen]bounds]];
????17 self.window.backgroundColor=[UIColor whiteColor];
????18
????19//a.????????tabBar??????
????20 UITabBarController*tb=[[UITabBarController alloc]init];
????21//??????????Window?????????
????22 self.window.rootViewController=tb;
????23
????24//b.???????????
????25 UIViewController*c1=[[UIViewController alloc]init];
????26 c1.view.backgroundColor=[UIColor grayColor];
????27 c1.view.backgroundColor=[UIColor greenColor];
????28 c1.tabBarItem.title=@"???";
????29 c1.tabBarItem.image=[UIImage imageNamed:@"tab_recent_nor"];
????30 c1.tabBarItem.badgeValue=@"123";
????31
????32 UIViewController*c2=[[UIViewController alloc]init];
????33 c2.view.backgroundColor=[UIColor brownColor];
????34 c2.tabBarItem.title=@"?????";
????35 c2.tabBarItem.image=[UIImage imageNamed:@"tab_buddy_nor"];
????36
????37 UIViewController*c3=[[UIViewController alloc]init];
????38 c3.tabBarItem.title=@"???";
????39 c3.tabBarItem.image=[UIImage imageNamed:@"tab_qworld_nor"];
????40
????41 UIViewController*c4=[[UIViewController alloc]init];
????42 c4.tabBarItem.title=@"????";
????43 c4.tabBarItem.image=[UIImage imageNamed:@"tab_me_nor"];
????44
????45
????46//c.????????????ITabBarController??
????47//c.1???????
????48//[tb addChildViewController:c1];
????49//[tb addChildViewController:c2];
????50
????51//c.2???????
????52 tb.viewControllers=@[c1??c2??c3??c4];
????53
????54
????55//2.????Window???????????????
????56[self.window makeKeyAndVisible];
????57 return YES;
????58}
????59
????60@end
???????Ч????
??????????????
????1.UITabBar
?????·???????????UITabBar?????UITabBarController??N??????????????UITabBar???????N??UITabBarButton???????????????
???????UITabBarButton??UITabBar?е?λ?????????UITabBar?????49??
???????????????У?UITabBarController??4???????????????UITabBar????4??UITabBarButton??UITabBar??????????????????
????2.UITabBarButton
????UITabBarButton??????????????????????????tabBarItem??????????
????c1.tabBarItem.title=@"???";
????c1.tabBarItem.image=[UIImage imageNamed:@"tab_recent_nor"];
????3.??????????????UITabBarController????????????
??????1??[tb addChildViewController:c1];
??????2??tb.viewControllers=@[c1??c2??c3??c4];
????????????????????????£?????????????в??????????????????????????????????View??
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11