IOS 7 Study - Displaying an Image on a Navigation Bar
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的更多相关文章
- 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 ...
- IOS 7 Study - UIViewController
Presenting and Managing Views with UIViewController ProblemYou want to switch among different views ...
- 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 ...
- 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 ...
- 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 ...
- IOS 7 Study - UISegmentedControl
You would like to present a few options to your users from which they can pick anoption, through a U ...
- IOS 7 Study - UIDatePicker
Picking the Date and Time with UIDatePicker effect: 1. declaring a property of type UIDatePicker #im ...
- 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 列表 ...
- IOS 怎么修改Navigation Bar上的返回按钮文本颜色,箭头颜色以及导航栏按钮的颜色
self.navigationController.navigationBar.barTintColor = [UIColor blackColor]; self.navigationControll ...
随机推荐
- ZOJ 2599 Graduated Lexicographical Ordering (数位DP)
首先要吐两行槽:看到集训队论文上有这道题,由于数位DP一律写成记忆化搜索形式的强迫症,就没去看论文上的几个函数是什么……:结果被这道题虐的脑细胞死光……,最后是用随机数据对拍AC程序然后发现BUG改掉 ...
- JDT入门
1.打开Java类型 要打开一个Java类或Java接口以进行编辑,可以执行以下操作之一: 在编辑器中所显示的源代码里选择所要编辑的Java类或Java接口的名字(或者简单地将插入光标定位到所要编辑的 ...
- 数往知来 asp.net 聊天室问题解决方案<十六>
1:在服务端创建了一个负责监听的sokcet //三个:采用TCP协议. ListenSocket = new Socket(AddressFamily.InterN ...
- GC算法 垃圾收集器
GC算法 垃圾收集器 参考:http://www.cnblogs.com/ityouknow/p/5614961.html 概述 垃圾收集 Garbage Collection 通常被称为“GC”,它 ...
- 使用JavaMail API发送邮件
发送邮件是很常用的功能,注册验证,找回密码,到货通知,欠费提醒等,都可以通过邮件来提醒. Java中发送邮件需要使用javax.mail.jar包,读者可以上网搜索或去官方下载,下载地址为: 下面贴上 ...
- 上传控件swfupload的使用笔记
1.下载下来的官方domo里不同的例子里会引入各自的JS,注意区分.可以直接拿官方例子来改成自己想要的例子. 2.注意PHP配置文件里也有最大上传文件限制,如果文件太大会上传不成功. 3.如果有问题可 ...
- Failed to read artifact descriptor--maven问题总结(能力工场)
在开发的过程中,作为新手,经常遇到Maven下载依赖的时候,"Failed to read artifact descriptor for xxx:jar"的错误 对于这种非业务相 ...
- gem openssl 出错
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources 1. ...
- 轻松学习Linux之内核编译
欢迎大家给我投票: http://2010blog.51cto.com/350944 650) this.width=650;" onclick='window.open("h ...
- nova service-list
nova-scheduler start/running, process 4820root@ruiy-controller-a:/var/log/nova# nova service-list+-- ...