技巧-底部切换按钮配置
来源:互联网 发布:编程ls是什么意思 编辑:程序博客网 时间:2024/06/11 15:32
底部切换按钮1
navigationController自带了一个工具栏,通过设置
self.navigationController.toolbarHidden = NO来显示工具栏,工具栏中的内容可以通过 viewController的toolbarItems来设置,显示的顺序和设置的NSArray中存放的顺序一致, 其中每一个数据都有一个对应的UIBarButtonItem对象,可以使用系统提供的很多常用风格 的对象,也可以根据需求进行自定义。
self.navigaConController.toolbarHidden = NO;
UIBarBu[onItem *one = [[UIBarBu[onItem alloc] initWithBarBu[onSystemItem:UIBarBu[onSystemItemAdd target:nil acCon:nil];
UIBarBu[onItem *two = [[UIBarBu[onItem alloc] initWithBarBu[onSystemItem:UIBarBu[onSystemItemBookmarks target:nil acCon:nil];
UIBarBu[onItem *three = [[UIBarBu[onItem alloc] initWithBarBu[onSystemItem:UIBarBu[onSystemItemAcCon target:nil acCon:nil];
UIBarBu[onItem *four = [[UIBarBu[onItem alloc] initWithBarBu[onSystemItem:UIBarBu[onSystemItemEdit target:nil acCon:nil];
UIBarBu[onItem *flexItem = [[UIBarBu[onItem alloc] initWithBarBu[onSystemItem:UIBarBu[onSystemItemFlexibleSpace target:nil acCon:nil]; // 间隔
[self setToolbarItems:@[one, flexItem, two, flexItem, three, flexItem, four, flexItem]];
底部切换按钮2
UITabBarController的创建
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.tbCtrl = [[UITabBarController alloc] init];
// 1. 生成tab上对应的VC
FirstViewController *item1 = [[FirstViewController alloc] init]; SecondViewController *item2 = [[SecondViewController alloc] init]; ThirdViewController *item3 = [[ThirdViewController alloc] init]; ThirdViewController *item4 = [[ThirdViewController alloc] init]; ThirdViewController *item5 = [[ThirdViewController alloc] init];
// 2. 加入到tabbar的数组中
NSArray *controllers = @[item1,item2,item3, item4, item5]; //3. 设置属性
self.tbCtrl.viewControllers= controllers;
self.tbCtrl. selectedIndex = 2; self.tbCtrl.delegate = self;
self.window.backgroundColor = [UIColor whiteColor]; self.window.rootViewController = self.tbCtrl; [self.window makeKeyAndVisible];
return YES;
- 技巧-底部切换按钮配置
- 底部切换按钮LuseenBottomNavigation
- ImageView实现APP底部按钮切换页面
- 分时底部按钮开发说明和配置
- Android自定义组合控件--底部多按钮切换
- 底部四个按钮的设置+fragment的切换
- 关于利用include实现底部按钮切换v…
- 在activity上添加Fragment及底部按钮切换
- 网页实战技巧--按钮背景切换
- tablayout+底部底部按钮
- 通过RadioGroup组件实现微信底部的切换按钮(Tab》
- Android控件Gridview实现仿支付宝首页,Fragment底部按钮切换和登录圆形头像
- 底部多个按钮切换Fragment,不重新实例化简单方法!
- 按钮切换
- android-list底部按钮
- 底部按钮中间突出
- popuwin 按钮底部
- 关于底部虚拟按钮
- jQuery插件
- uva 11198 Dancing Digits(隐式图搜索+哈细判重)
- webview 加载url后 缓存问题
- ThinkPHP学习笔记(六)常用的连贯操作和模版的使用
- 采用SHELL,通过SQL LOAD导入一定格式的txt文件至数据库中
- 技巧-底部切换按钮配置
- NYOJ 270题 数分解
- boost::string_algo详解7——join的应用
- ubuntu中ANT的安装和配置
- SQL*LOADER选择性导入csv部分列
- interview
- jQuery插件
- 地理位置坐标转换
- H.264的Slice及Slice类型