UINavigationController和UITabBarController合用。
来源:互联网 发布:淘宝怎么上首页 编辑:程序博客网 时间:2024/04/28 18:22
TabPage1 *firstViewControlle = [[TabPage1 alloc] init]; UINavigationController *nav1 = [[UINavigationController alloc] initWithRootViewController: firstViewControlle]; UITabBarItem *time = [[UITabBarItem alloc] initWithTitle: @"First" image: nil tag: 0]; time.image = [UIImage imageNamed:@""]; nav1.tabBarItem = time; TabPage2 *secondViewController = [[TabPage2 alloc] init]; UINavigationController *nav2 = [[UINavigationController alloc] initWithRootViewController: secondViewController]; UITabBarItem *time2 = [[UITabBarItem alloc] initWithTitle: @"second" image: nil tag: 1]; nav2.tabBarItem = time2; UITabBarController *tabBarController = [[UITabBarController alloc] init]; NSArray *array = [NSArray arrayWithObjects: nav1,nav2, nil]; tabBarController.viewControllers = array; [self presentViewController:tabBarController animated:YES completion:nil];///////////在TabPage1中self.navigationitem.title = @"111";
//设置Navigation Bar背景图片
UIImage *title_bg = [UIImageimageNamed:@"头.png"]; //获取图片
CGSize titleSize =self.navigationController.navigationBar.bounds.size; //获取Navigation Bar的位置和大小
//title_bg.size = [self scaleToSize:title_bg size:titleSize];//设置图片的大小与Navigation Bar相同
[nav1.navigationBarsetBackgroundImage:title_bgforBarMetrics:UIBarMetricsDefault]; //设置背景
[nav1.navigationBarsetBarStyle:UIBarStyleBlack];
设置Title颜色
NSMutableDictionary *dic = [NSMutableDictionarydictionary];
[dic setObject:[UIColorwhiteColor]forKey:UITextAttributeTextColor];
[dic setObject:[UIFontsystemFontOfSize:19]forKey:UITextAttributeFont];
self.navigationController.navigationBar.titleTextAttributes = dic;
- UINavigationController和UITabBarController合用。
- UINavigationController和UITabBarController合用
- UINavigationController和UITabBarController合用。
- UINavigationController和UITabBarController合用。
- UINavigationController和UITabBarController合用[转载比较好理解]
- 隐藏UINavigationController和UITabBarController
- UITabBarController和UINavigationController混用
- UINavigationController和UITabBarController
- UINavigationController和UITabBarController混用
- UItabBarController和UINavigationController结合使用
- UINavigationController和UITabBarController的集成
- UITabBarController 和 UINavigationController 的 popToRootViewController
- iOS 自定义UINavigationController和UITabBarController
- UINavigationController和UITabbarController内部结构解析
- UITabBarController和UINavigationController搭配使用
- UINavigationController跳转到UITabBarController和UITabBarController跳转到 UINavigationController
- UINavigationController跳转到UITabBarController和UITabBarController跳转到 UINavigationController
- UINavigationController,UITabBarController
- linux驱动学习之tasklet分析
- 利用特征点(Brief,ORB,SIFT)进行图像匹配,模板匹配
- 暖风熏的游人醉 直把杭州作汴州 题临安邸--林升
- Android Camera框架分析
- JS根据表单中的选项,自动生成span标签后显示选中的内容
- UINavigationController和UITabBarController合用。
- StringUtil包函数(org.apache.commons.lang.StringUtil)之用法
- 配置《UNIX环境高级编程》中程序的运行环境,解决“apue.h:没有那个文件或目录”错误
- 交叉编译glibc时遇到的include/asm-arm目录不存在的问题
- Latex 安装 & Hello World
- 免密码ssh设置
- Android之短信广播接收内容
- PHP框架CodeIgniter学习笔记(一)
- Java PreparedStatement 的用法