1. rightBarButtonItem的创建

-(void)initRightBar{
    UIBarButtonItem *done =[UIBarButtonItem rightItemWithText:@"新建优惠" withTextColor:[UIColor nvColorWithf63] target:self action:@selector(gotoCreateCoupon)];
    self.navigationItem.rightBarButtonItem = done;
}

2. 使用UIButton创建UIBarButtonItem

- (UIBarButtonItem *)creatCouponButtonItem {
    UIButton *creatCouponButton = [[UIButton alloc] initWithFrame:CGRectMake(, , , )];
    [creatCouponButton setTitle:@"新建优惠" forState:UIControlStateNormal];
    [creatCouponButton setTitleColor:[UIColor nvColorWithf63] forState:UIControlStateNormal];
    creatCouponButton.titleLabel.font = [UIFont nvFontWithSize14];
    [creatCouponButton addTarget:self action:@selector(gotoCreateCoupon) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *buttonItem = [[UIBarButtonItem alloc] initWithCustomView:creatCouponButton];
    return buttonItem;
}

UIBarButtonItem的创建的更多相关文章

  1. iOS开发系列--通讯录、蓝牙、内购、GameCenter、iCloud、Passbook系统服务开发汇总

    --系统应用与系统服务 iOS开发过程中有时候难免会使用iOS内置的一些应用软件和服务,例如QQ通讯录.微信电话本会使用iOS的通讯录,一些第三方软件会在应用内发送短信等.今天将和大家一起学习如何使用 ...

  2. iOS--通讯录、蓝牙、内购、GameCenter、iCloud、Passbook等系统服务开发汇总

    iOS开发过程中有时候难免会使用iOS内置的一些应用软件和服务,例如QQ通讯录.微信电话本会使用iOS的通讯录,一些第三方软件会在应用内发送短信等.今天将和大家一起学习如何使用系统应用.使用系统服务: ...

  3. iOS学习26之UINavigationController

    1. UINavigationController 1> 概述 UINavigationController : 导航控制器, 是 iOS 中最常用的多视图控制器之一, 用它来管理多个视图控制器 ...

  4. iOS开发系列通讯录、蓝牙、内购、GameCenter、iCloud、Passbook系统服务开

    --系统应用与系统服务 iOS开发过程中有时候难免会使用iOS内置的一些应用软件和服务,例如QQ通讯录.微信电话本会使用iOS的通讯录,一些第三方软件会在应用内发送短信等.今天将和大家一起学习如何使用 ...

  5. iOS 利用self.navigationItem.backBarButtonItem修改后退按钮文字

    @property(nonatomic,retain) UIBarButtonItem *backBarButtonItem; // Bar button item to use for the ba ...

  6. iOS - UIToolbar

    前言 NS_CLASS_AVAILABLE_IOS(2_0) __TVOS_PROHIBITED @interface UIToolbar : UIView <UIBarPositioning& ...

  7. ios 修改导航条返回按钮

    ios 修改导航条返回按钮 方式一:使用系统的:可以更改系统的文字:以及通过设置导航条的颜色来达到预期的效果 UIBarButtonItem *backBtns = [[UIBarButtonItem ...

  8. IOS中调用系统的电话、短信、邮件、浏览功能

    iOS开发系列--通讯录.蓝牙.内购.GameCenter.iCloud.Passbook系统服务开发汇总 2015-01-13 09:16 by KenshinCui, 26990 阅读, 35 评 ...

  9. Swift 全功能的绘图板开发

    要做一个全功能的绘图板,至少要支持以下这些功能: 支持铅笔绘图(画点) 支持画直线 支持一些简单的图形(矩形.圆形等) 做一个真正的橡皮擦 能设置画笔的粗细 能设置画笔的颜色 能设置背景色或者背景图 ...

随机推荐

  1. 关于listView 中的聚焦问题

    我在使用listView+adapter 中,遇到一个问题,就是item项添加了若干个可以被监听的控件后 在listView中的setOnItemClickListener失效了 原因是焦点已经在it ...

  2. JS验证金额

    <script type="text/javascript">        function ismoney(obj) {            check(obj) ...

  3. Dependency Properties

      Introduction Value resolution strategy The magic behind it How to create a DepdencyProperty Readon ...

  4. Intellij IDEA常用快捷键——Mac版

    http://blog.csdn.net/longshen747/article/details/17204699 http://totohust.iteye.com/blog/1035550 设置自 ...

  5. Linux添加Terminal快捷键和文件系统的总结

    一:Fedora 怎样设置终端快捷键 百度连接:http://jingyan.baidu.com/article/cb5d61053598ed005d2fe05c.html ubuntu里面不用设置就 ...

  6. Storm-166:Nimbus HA solution based on Zookeeper

    Nimbus HA feature is quite important for our application running on the storm cluster. So, we've bee ...

  7. ACM: Gym 100935B Weird Cryptography - 简单的字符串处理

    Weird Cryptography Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u ...

  8. 服务器端接受Json数据的绑定实现

    1.在方法参数前加上JsonRead<T>的泛型特性 public ActionResult GetData([JsonRead(typeof(PostData))]PostData po ...

  9. thinkphp常用Config.php配置项

    <?php return array( //'配置项'=>'配置值' 'DB_HOST' => 'localhost', 'DB_USER' => 'root', 'DB_PW ...

  10. SpringMVC+Thymeleaf如何处理URL中的动态查询参数

    1.使用一个Map<String, String>接收数据 When you request a Map annotated with @RequestParam Spring creat ...