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 ...
随机推荐
- 自定义View实现图片的绘制、旋转、缩放
1.图片 把一张JPG图片改名为image.jpg,然后拷贝到项目的res-drawable中. 2.activity_main.xml <LinearLayout xmlns:android= ...
- 页面性能测试&提升方式
性能测试包括:web系统页面测试.web系统后台测试 2种方式来提升你的web 应用程序的速度: ● 减少请求和响应的往返次数 ● 减少请求和响应的往返字节大小. 详细的看此文http://www.5 ...
- 在Mac OS X 通过抓包、“第三方下载工具”加速下载、安装APP或系统
#!/bin/bash ######################################################################################## ...
- 将垃圾送入无底洞,顺便整理dev知识
相信用过Linux的童鞋们都用过crontab来做定时任务,不需要额外的安装程序和配置,一条简单的语句搞定定时任务,但是小伙伴们发现了没,如果你的定时任务执行频率很高而且会产生大量的输出的话,你的老爷 ...
- cdh5.4、cm5.4 安装详细步骤
安装准备: 1.centos6.5 64位 虚拟机,内存分配4G.硬盘位20G 2.cm5.4 cdh5.4 包 安装步骤 一.centos安装完后,进行系统配置 1.关闭防火墙 service ip ...
- ansible官方文档翻译之变量
Ansible变量 在使用ansible变量的时候,主要是因为各个系统的不同,从而需要使用不同的变量来进行设置,例如在设置一些配置文件的时候,有大部分内容是相同的,但是一部分内容是和主机的ip地址或者 ...
- Android APP的安装路径
转载自:http://blog.csdn.net/libaineu2004/article/details/25247711 一.安装路径在哪? Android应用安装涉及到如下几个目录: syste ...
- hadoop 异常及处理总结-01(小马哥-原创)
试验环境: 本地:MyEclipse 集群:Vmware 11+ 6台 Centos 6.5 Hadoop版本: 2.4.0(配置为自动HA) 试验背景: 在正常测试MapReduce(下简称MR)程 ...
- HW7.18
public class Solution { public static void main(String[] args) { int[][] m = {{1, 2}, {3, 4}, {5, 6} ...
- cannot restore segment prot after reloc: Permission denied
编辑/etc/selinux/config,找到这段:# This file controls the state of SELinux on the system. # SELINUX= can t ...