Problem
You want to display an image instead of text as the title of the current view controller
on the navigation controller

Solution
Use the titleView property of the view controller’s navigation item

- (void)viewDidLoad {
[super viewDidLoad]; /* Create an Image View to replace the Title View */
UIImageView *imageView =
[[UIImageView alloc]
initWithFrame:CGRectMake(0.0f, 0.0f, 100.0f, 40.0f)];
imageView.contentMode = UIViewContentModeScaleAspectFit; /* Load an image. Be careful, this image will be cached */
UIImage *image = [UIImage imageNamed:@"Logo"]; /* Set the image of the Image View */
[imageView setImage:image]; /* Set the Title View */
self.navigationItem.titleView = imageView;
}

IOS 7 Study - Displaying an Image on a Navigation Bar的更多相关文章

  1. Status bar and navigation bar appear over my view's bounds in iOS 7

    转自:http://stackoverflow.com/questions/17074365/status-bar-and-navigation-bar-appear-over-my-views-bo ...

  2. IOS 7 Study - UIViewController

    Presenting and Managing Views with UIViewController ProblemYou want to switch among different views ...

  3. IOS 7 Study - Manipulating a Navigation Controller’s Array of View

    ProblemYou would like to directly manipulate the array of view controllers associated with aspecific ...

  4. IOS 7 Study - Implementing Navigation with UINavigationController

    ProblemYou would like to allow your users to move from one view controller to the other witha smooth ...

  5. IOS 7 Study - UIActivityViewController(Presenting Sharing Options)

    You want to be able to allow your users to share content inside your apps with theirfriends, through ...

  6. IOS 7 Study - UISegmentedControl

    You would like to present a few options to your users from which they can pick anoption, through a U ...

  7. IOS 7 Study - UIDatePicker

    Picking the Date and Time with UIDatePicker effect: 1. declaring a property of type UIDatePicker #im ...

  8. IOS学习-报错误 Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.

    环境:XCODE:5.0.2  IOS7模拟器 界面:使用storyboard 拖拽 简单应用:一个CoreData的CRUD用例. 界面如下图(一个UITableViewController 列表 ...

  9. IOS 怎么修改Navigation Bar上的返回按钮文本颜色,箭头颜色以及导航栏按钮的颜色

    self.navigationController.navigationBar.barTintColor = [UIColor blackColor]; self.navigationControll ...

随机推荐

  1. JVM参数汇总

    一.java启动参数共分为三类: 其一是标准参数(-),所有的JVM实现都必须实现这些参数的功能,而且向后兼容:其二是非标准参数(-X),默认jvm实现这些参数的功能,但是并不保证所有jvm实现都满足 ...

  2. 答 “SOA会不会造成IT黑洞?”

    [文/ 任英杰] 随意间看到支点网的“SOA会不会造成IT黑洞”一文,作者对SOA的认识颇有以偏概全之嫌,写点自己的感想,作为应和吧. 作者的二个对SOA的观点有些偏颇:“SOA就是一种系统集成,它是 ...

  3. 浅谈jquery选择器

    首先来说说jquery选择器的优势: 1.简洁的写法  2.支持css1.0到3.0选择器 3.完善的处理机制. 再来说说分类: jquery选择器分为基本选择器.层次选择器.属性选择器.基本过滤选择 ...

  4. Eclipse + Idea + Maven + Scala + Spark +sbt

    http://jingpin.jikexueyuan.com/article/47043.html 新的scala 编译器idea使用 https://www.jetbrains.com/idea/h ...

  5. Python 学习笔记(五)杂项

    1. Assert assert len(unique_characters) <= 10, 'Too many letters' #…等价于: if len(unique_characters ...

  6. String - 兴趣解读

    个优点: . 以下代码的HashCode是否相同,它们是否是同个对象: . 以下代码的HashCode是否相同,他们是否是同个对象:        . 以下代码的HashCode是否相同,他们是否是同 ...

  7. JDBC连接Oracle数据库的问题

    场景:最近做一个java web项目,使用jdbc连接Oracle数据库,遇到了两个问题. 问题1:jdbc连接不上Ubuntu Oracle服务器? 后来发现这个问题的原因是由于连接字符串写错了,修 ...

  8. openstack-dbs

    真正的服务器派生出线程 和子进程处理多个连接当允许客户端加入聊天室,他发送的任何一条文本都将广播给聊天室中的每个用户,除非文本是服务器CLI当广播一条消息,消息前面将加上发送者的昵称 以尖括号括住昵称 ...

  9. c#与vb.net在App_Code里面编译要通过,需要以下web.config的配置

    web.config的配置: <system.web> <codeSubDirectories> <add directoryName="VB"/&g ...

  10. <转>linux进程间通信<一>

    这篇文章真心不错,只是代码比较久,有些地方需求大家自行修改.先全文转载,以备复习只用.原文链接为:http://www.ibm.com/developerworks/cn/linux/l-ipc/pa ...