• 自定义导航栏多个按钮


    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; 

        

  • 相关阅读:
    ie兼容问题整理
    jQuery Easing 使用方法及其图解
    前端模块化学习
    velocity常用语句速查表
    table插件实现
    表单自动提交问题整理
    移动端开发
    工具的使用及配置
    《TCP/IP详解 卷1:协议》读书笔记
    iOS 内存泄漏
  • 原文地址:https://www.cnblogs.com/kexiaozhu/p/4414325.html
Copyright © 2020-2023  润新知