UIToolbar* tools = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 150, 45)];
[tools setTintColor:[self.navigationController.navigationBar tintColor]];
[tools setAlpha:[self.navigationController.navigationBar alpha]];
NSMutableArray* buttons = [[NSMutableArray alloc] initWithCapacity:2];
UIBarButtonItem *anotherButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd
target:self action:@selector(clickSettings:)];
UIBarButtonItem *anotherButton1 = [[UIBarButtonItem alloc] initWithTitle:@"Edit" style:UITabBarSystemItemContacts
target:self action:@selector(clickEdit:)];
[buttons addObject:anotherButton];
[anotherButton release];
[buttons addObject:anotherButton1];
[anotherButton1 release];
[tools setItems:buttons animated:NO];
[buttons release];
UIBarButtonItem *myBtn = [[UIBarButtonItem alloc] initWithCustomView:tools];
self.navigationItem.rightBarButtonItem = myBtn;
[myBtn release];
[tools release];
分享到:
相关推荐
主要介绍了iOS应用开发中导航栏按钮UIBarButtonItem的添加教程,文中详细介绍了使用UINavigationController导航控制器添加的过程,需要的朋友可以参考下
1、首先在程序入口界面AppDelegate中添加导航栏控制器,并且创建根视图控制器RootViewController 2、其次就是对导航堆栈进行页面的pop和push了 3、再次就是对每个页面进行导航按钮的设置 4、注意,本页面只能设置...
我们写iOS项目的时候,基本都是一个UINavigationController套一个UITabBarController的形式,就是上面一个导航栏,下面几个按钮的工具条的形式。我写了几个应用,发现如果每次都重新写的话完全就是浪费精力和时间,...
IOS修改导航栏高度demo,项目非常简单简洁,方便大家参考如何正确地修改UINavigationController中的MyNavigationBar高度,博客地址https://blog.csdn.net/u010775335/article/details/86176848
作者LeoiOS,源码LCNavigationController,除 UINavigationController 外最流行的 NavigationController!效果参考 App:腾讯新闻、百度音乐等等。
UINavigationController导航控制器
要安装它,只需将以下行添加到您的 Podfile 中: pod "NavigationMenuController" 作者 Ilter Cengiz, 执照 NavigationMenuController 在 MIT 许可下可用。 有关详细信息,请参阅许可证文件。
一个自定义的导航栏,只需要在使用的类中引入头文件就可以直接使用 但是要在AppDelegate中将nav设置为rootView self.navigation = [[UINavigationController alloc]initWithRootViewController:self....
很多时候我们创建一个基于UITabBarController的application以后还希望能够在每个tab view都可以实现导航控制,即添加一个UINavigationController来实现tabview内部的view之间的切换,这即是本文所要介绍的。
上传的demo关于UINavigationController中back按钮的重写方法, UINavigationController的back按妞本身是没有监听方法的,但是我们通过添加类目可以使back按钮具有监听的作用.让我们能在UINavigationController触发返回...
UIViewController添加多个UIViewController。可以把UIViewController的View当作容器,让其他UIViewController添加进该View,并可以在多个UIViewController间切换。
[[UIBarButtonItem alloc] initWithTitle与[[UIBarButtonItem alloc] initWithBarButtonSystemItem的区别 - http://blog.csdn.net/moon_prince2013/article/details/49068643 Objective-C中的SEL - ...
UINavigation 代码 IOS 导航栏 Demo
UINavigationController 简单使用方法,增加自定义导航按钮。图片按钮,switch按钮。
UInavigationController笔记
导航控制器(UINavigationController)用来管理一系列显示层次型信息的场景。一般而言,逐步显示更详细的信息。 导航控制器 -- 用户在场景之间切换时,导航控制器依次将视图控制器压入(push)堆栈中,且当前场景的...
IOS 导航 UINavigationController,说明了setBackBarButtonItem,setRightBarButtonItem,setLeftBarButtonItem,setTitleView
IOS7 UINavigationController滑动Demo,解决了在push后的页面可以滑动返回的问题。