首页 > 其他 > 详细

自定义导航栏多个按钮

时间:2015-04-10 14:59:59      阅读:200      评论:0      收藏:0      [点我收藏+]

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; 

    

 

自定义导航栏多个按钮

原文:http://www.cnblogs.com/kexiaozhu/p/4414325.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!