自定义导航栏多个按钮
2015-04-10 13:23
357 查看
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:UIBarButtonSystemItemSearch
target:self action:@selector(clickSettings:)];
UIBarButtonItem *anotherButton1 = [[UIBarButtonItem alloc] initWithTitle:@"Edit" style:UITabBarSystemItemContacts
target:self action:@selector(clickEdit:)];
[buttons addObject:anotherButton];
[buttons addObject:anotherButton1];
[tools setItems:buttons animated:NO];
UIBarButtonItem *myBtn = [[UIBarButtonItem alloc] initWithCustomView:tools];
self.navigationItem.rightBarButtonItem = myBtn;
[tools setTintColor:[self.navigationController.navigationBar tintColor]];
[tools setAlpha:[self.navigationController.navigationBar alpha]];
NSMutableArray* buttons = [[NSMutableArray alloc] initWithCapacity:2];
UIBarButtonItem *anotherButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSearch
target:self action:@selector(clickSettings:)];
UIBarButtonItem *anotherButton1 = [[UIBarButtonItem alloc] initWithTitle:@"Edit" style:UITabBarSystemItemContacts
target:self action:@selector(clickEdit:)];
[buttons addObject:anotherButton];
[buttons addObject:anotherButton1];
[tools setItems:buttons animated:NO];
UIBarButtonItem *myBtn = [[UIBarButtonItem alloc] initWithCustomView:tools];
self.navigationItem.rightBarButtonItem = myBtn;
相关文章推荐
- 自定义导航栏返回按钮--拦截push方法实现
- iOS开发之自定义导航栏返回按钮右滑返回手势失效的解决
- 自定义导航栏上的返回按钮
- 自定义导航栏的按钮,文字
- IOS 自定义导航栏标题和返回按钮标题
- iPhone自定义导航栏按钮
- 自定义导航按钮UIBarButtonItem
- 自定义导航栏按钮UIBarButtonItem 文字或图片
- 自定义导航返回按钮
- Swift- 自定义导航栏背景、标题和返回按钮属性
- iOS开发之自定义导航栏返回按钮右滑返回手势失效的解决
- ios之自定义导航栏上的返回按钮
- 自定义导航栏左按钮
- 自定义导航返回按钮是用customView不可以的原因?
- 自定义导航栏按钮UIBarButtonItem 文字或图片(定制)
- 自定义导航按钮UIBarButtonItem
- 自定义导航左按钮
- iOS之自定义导航按钮UIBarButtonItem的样式
- IOS 自定义导航栏题目和返回按钮标题
- JQuery Mobile入门——自定义导航栏链接按钮图标