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; 

        

  • 相关阅读:
    HTML、CSS、JS 复习——序
    HTML + CSS短标题(二,三,四文字长度)两端对齐的方式
    Supper关键字
    java的重写
    java重载
    Java继承
    JAVA访问权限控制
    (转)java类初始化顺序
    Java 数组和集合
    Java 方法签名
  • 原文地址:https://www.cnblogs.com/kexiaozhu/p/4414325.html
Copyright © 2011-2022 走看看