- 1、本文档共22页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
IOS小汇【DOC精选】
导航控制器
?// 让iOS7 导航控制器不透明
?
1
2 ????self.navigationController.navigationBar.translucent?=?NO;
????self.edgesForExtendedLayout?=?UIRectEdgeNone; //隐藏导航栏
?
1 [[self?navigationController]?setNavigationBarHidden:YES?animated:YES]; self.title?=?@Settings;?//?改变标题
//其实这是一个区域?self.navigationItem.titleView?=?
这是一个View?那就好办了,我们可以添加button?imageView?UISegmentedControl选项卡 ?
1
2
3
4
5 ????//视图控制器
ViewController1*?vc?=?[[ViewController1?alloc]?init];
????//导航控制器
????UINavigationController*?nc?=?[[UINavigationController?alloc]?initWithRootViewController:vc];
????self.window.rootViewController?=?nc; ?
1
2
3
4
5
6
7
8
9 ViewController2*?vc2?=?[[ViewController2?alloc]?init];
//进入第二个页面
[self.navigationController?pushViewController:vc2?animated:YES];
//返回上一个页面
[self.navigationController?popViewControllerAnimated:YES];
//返回根页面
????[self.navigationController?popToRootViewControllerAnimated:YES];
//返回指定页面
??[self.navigationController?popToViewController:vcX?animated:YES]; UIBarButtonItem,也就是左右两个按钮,下面添加左面按钮:?
1
2
3 UIBarButtonItem?*leftButton?=?[[UIBarButtonItem?alloc]?initWithBarButtonSystemItem:UIBarButtonSystemItemReply?target:self?action:@selector(clickLeftButton)];
//初始化并不是initWithBarButt....一种,聪明的你肯定知道comand点进去了。有initWithTitle。。。等等,这个可以改变按钮文字
????self.navigationItem.leftBarButtonItem?=?leftButton; 当然左边的默认显示的。右面的就不在这里添加了吧
下面是按钮样式,自行参考
toolBar:
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 //显示toolBar
[self.navigationController?setToolbarHidden:NO];
//添加toolBar?把UIBarButtonItem?放到,,,,,///UIBarButtonSystemItemFlexibleSpace?空白按钮风格
[self?setToolbarItems:[NSArray?arrayWithObjects:,,,,?nil];
?
?
///自己添加UIToolbar
初始化?用setItems?添加?UIBarButtonItem
????UIToolbar*?toolBar?=?[[UIToolbar?alloc]?initWithFrame:CGRectMake(0,?416-84,?320,?44)];
????toolBar.hidden?=?YES;
????//toolBar.backgroundColor?=?[UIColor?redColor];
????[self.view?addSubview:toolBar];
????//批量给Toolbar添加按钮
????NSMutableArray*?array?=?[NSMutableArray?array];
????for?(int?i?=?0;?i??7;
您可能关注的文档
- In the classroom(Period )【DOC精选】.doc
- In-class Translation Excercises V【DOC精选】.doc
- Industrial Design Excellence Awards Good Design Award PIN UPP【DOC精选】.doc
- imagine&shape【DOC精选】.doc
- infochi【DOC精选】.doc
- innsbruck【DOC精选】.doc
- Initiating the Inactive Employees Credit Card Process_SPD【DOC精选】.doc
- Inputbox经典用法【DOC精选】.doc
- InputBox函数【DOC精选】.doc
- Insight issue free article【DOC精选】.doc
最近下载
- (完整版)电气设备安装标准规范.pdf
- GB∕T 13861-2022生产过程危险和有害因素分类、解读与示例说明清单【危险源识别工具】(雷泽佳-2024A0).doc
- 2021年中国光大银行校园招聘在线测试笔试题考试真题笔经.doc
- 新浪·按键精灵开发者1级认证参考解析.docx VIP
- 2023年福建省各地中考语文模拟卷【文学类文本阅读题解及答案解析】汇集.docx VIP
- 皮亚杰认知发展论.ppt VIP
- 2.1 几代中国人的美好夙愿 课件初中读本.ppt
- 流域化“厂网一体”运营模式的探索与实践.pdf
- 半导体制造技术离子注入工艺.pptx
- 全国普通话水平测试用普通话词语表(表一+表二).pdf
文档评论(0)