IOS小汇【DOC精选】.doc

  1. 1、本文档共22页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 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;

文档评论(0)

taotao0b + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档