zoukankan      html  css  js  c++  java
  • 自定义导航栏多个按钮

    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; 

        

  • 相关阅读:
    python-Mitmproxy抓包
    pytest-html、cov、xdist
    python-unittest添加用例的几种方式
    python-*args、**kargs用法
    One,Two,Three,Ak模板
    栈和队列小练习
    区块链入门介绍笔记
    Research on Facebook and Social Graph
    线段树板子的小修改
    htaccess远古时期技术了解一下
  • 原文地址:https://www.cnblogs.com/kexiaozhu/p/4414325.html
Copyright © 2011-2022 走看看