UITabBarController
开始运行,只加载第一个页面,使用哪个再加载哪个,不销毁
UIViewController *v1 = [UIViewController new];
[tabBarController addChildViewController:v1];
UITabBar
UITabBarController 下方的导航栏
UITabBarButton
UITabBarButton 里由什么内容,由对应子控制器的 tabBarItem 属性决定tabBarItem 有以下属性影响UITabBarButton 的内容
@property(nonatomic,copy) NSString *title;
@property(nonatomic,retain) UIImage *image;
@property(nonatomic,retain) UIImage *selectedImage;
@property(nonatomic,copy) NSString *badgeValue;
v1.tabBarItem.title = @"联系人";
v1.tabBarItem.image = [UIImage imageNamed:@"pic"];
App主流UI框架结构
跳转方式
Push 的默认效果:新控制器从右往左,直到盖住之前的控制器,一般是业务逻辑有关系使用Modal 的默认效果:新控制器从屏幕下往上钻,直到盖住之前的控制器,一般是业务逻辑没有关系使用
-(void)persentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion
-(void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))completion
代码跳转
- 以
Modal 的形式展示控制器 该方法是谁负责显示,谁负责关闭,A打开B,B运行dismissViewControllerAnimated 时,其实是向A发送消息,由A负责关闭
UIViewController *VC = [UIViewController new];
VC.view.backgroundColor = [UIColor redColor];
VC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentViewController:VC animated:YES completion:^{
NSLog(@"跳转成功!");
}];
[self.navigationController pushViewController:VC animated:YES];
|