UIImage *btnimage = [UIImage imageNamed:@"about.png"];
UIButton *btn = [[UIButton alloc] initWithFrame:self.navigationController.navigationBar.frame];
btn.showsTouchWhenHighlighted = YES;
[btn addTarget:self action:@selector(infoAction:) forControlEvents:UIControlEventTouchUpInside];
[btn setImage:btnimage forState:UIControlStateNormal]; UIBarButtonItem *rightBtn = [[UIBarButtonItem alloc] initWithCustomView:btn];
[self.navigationItem setRightBarButtonItem:rightBtn];

ios 自定义NavgationBar的按钮的更多相关文章

  1. iOS自定义的UISwitch按钮

    UISwitch开关控件 开关代替了点选框.开关是到目前为止用起来最简单的控件,不过仍然可以作一定程度的定制化. 一.创建 UISwitch* mySwitch = [[ UISwitchalloc] ...

  2. iOS 自定义UINavigationController返回按钮

    主要代码如下: //自定义导航栏返回按钮 self.navigationItem.leftBarButtonItem = ({ //导航栏返回背景视图 UIView *view = [[UIView ...

  3. iOS 自定义NavigationBar右侧按钮rightBarButtonItem

    自定义右侧的一个按钮 UIBarButtonItem *myButton = [[UIBarButtonItem alloc] initWithTitle:@"主页" style: ...

  4. iOS 自定义NavigationBar右侧按钮rightBarButtonItem--button

    //两个按钮的父类view UIView *rightButtonView = [[UIView alloc] initWithFrame:CGRectMake(, , , )]; //历史浏览按钮 ...

  5. 【iOS自定义键盘及键盘切换】详解

    [iOS自定义键盘]详解 实现效果展示: 一.实现的协议方法代码 #import <UIKit/UIKit.h> //创建自定义键盘协议 @protocol XFG_KeyBoardDel ...

  6. iOS自定义转场动画实战讲解

    iOS自定义转场动画实战讲解   转场动画这事,说简单也简单,可以通过presentViewController:animated:completion:和dismissViewControllerA ...

  7. iOS 自定义TabBarController

    转自:http://blog.csdn.net/xn4545945/article/details/35994863 一.自定义的思路 iOS中的TabBarController确实已经很强大了,大部 ...

  8. IOS 修改UIAlertController的按钮标题的字体颜色,字号,内容

    IOS 修改UIAlertController的按钮标题的字体颜色,字号,内容 UIAlertController *alertVC = [UIAlertController alertControl ...

  9. iOS 自定义选项卡-CYLTabBarController

    正常的选项卡流程 cocoapods就不说了 创建一个CYLTabBarControllerConfig类 #import <Foundation/Foundation.h> #impor ...

随机推荐

  1. HTTP API 设计指南(基础部分)

    前言 这篇指南介绍描述了 HTTP+JSON API 的一种设计模式,最初摘录整理自 Heroku 平台的 API 设计指引 Heroku 平台 API 指引. 这篇指南除了详细介绍现有的 API 外 ...

  2. Python RGB 和HSV颜色相互转换

    转自:http://outofmemory.cn/code-snippet/1002/Python-RGB-HSV-color-together-switch Python RGB 和HSV颜色相互转 ...

  3. chrome浏览器插件推荐——Vimium 篇

    Vimium 是chrome底下的一个插件,所有chrome浏览器或者是基于chrome内核的浏览器(比如我用的Vivaldi)都可以使用这个插件.它提供了大量快捷键来方便键盘党浏览网页.目前在Chr ...

  4. e685. 显示页面格式窗口

    The page format dialog allows the user to change the default page format values such as the orientat ...

  5. e643. 以匿名类处理事件

    If an event handler is specific to a component (that is, not shared by other components), there is n ...

  6. 常用Javascript函数与原型功能收藏

    // 重复字符串 String.prototype.repeat = function(n) { return new Array(n+1).join(this); } // 替换全部 String. ...

  7. ubuntu设置中文拼音输入法

    转载  http://www.cnblogs.com/zhj5chengfeng/archive/2013/06/23/3150620.html

  8. MathType中输入破折号的教程

    MathType公式编辑器中的包含的各种数学符号与模板已经足够我们在编辑公式时使用了,但是除此之外,MathType还有一些符号并不是数学专有的符号,但是在数学中也偶尔会用到,比如破折号.MathTy ...

  9. JavaScript第五天之数组

    <script> var a=[1,2,3]; //var a=new Array(1,2,3); //alert(a.length); alert(a[0]); </script& ...

  10. linux中,查看某个命令是来自哪个RPM包或者是通过哪个RPM包安装的

    需求描述: 今天在测试ssh命令到底是哪个RPM包,安装之后生成的,找了一些文档 在这里进行记录下,主要是rpm -qf命令的使用,查询文件在哪个包里. 操作过程: 1.通过whereis 定位ssh ...