UINavigationController与UITabbarController的样式
之前虽然也手写过这两中视图控制器,但是更多的还是使用SB来创建,最近发现了一些问题,现在总结一下。
1.改变UINavigationBar的颜色
在UINavigationController中,之前只需要设置UINavigationController.navigationBar.tintColor 就可以改变navigationBar的颜色了,在最新的API中苹果对这个属性就行了修改了。
添加了一个属性barTintColor,以前的tintColor不再对bar的颜色产生影响,改变颜色需要用barTintColor.
2.设置UINavigationBar的title和UITabBarController下面item的文字为不同的标题
当一个视图控制器是UINavigationController的当前控制器时,如果设置了self.title属性,那么当前视图的navigationBar的title就是会自动取self.title的值。如果当前视图控制器还在tabBarController中,那么下面item的title也会取self.title,如果想要bar上面的文字和item的文字不一样,那么需要单独的对bar上面的文字设定,即除了设置self.title 意外还要在设置self.navigationItem.title的值,来吧bar上面的标题改回来,还可以单独设置item上的文字,self.navigationController.tabbarItem.title对该属性修改即可。
3.自定义UINavigationBar中间视图
UINavigationBar中有个titleView属性,可以定制视图来放置在中间位置,比如可以把等待指示器放在这里。
4.改变UINavigationBar title的文字样式
UINavigationBar中有个属性为titleTextAttributes,比如要把文字设置为18号红色,那么可以用NSFontAttributeName 和 NSForegroundColorAttributeName来分别设置文字样式和颜色。
UINavigationController与UITabbarController的样式的更多相关文章
- UINavigationController与UITabBarController相关问题
UINavigationController与UITabBarController相关问题 UINavigationController与UITabBarController混用是非常常见的,有时候会 ...
- iOS开发——实战OC篇&环境搭建之Xib(玩转UINavigationController与UITabBarController)
iOS开发——实战OC篇&环境搭建之Xib(玩转UINavigationController与UITabBarController) 前面我们介绍了StoryBoard这个新技术,和纯技术 ...
- iOS开发——实战OC篇&环境搭建之纯代码(玩转UINavigationController与UITabBarController)
iOS开发——实战OC篇&环境搭建之纯代码(玩转UINavigationController与UITabBarController) 这里我们就直接上实例: 一:新建一个项目singleV ...
- iOS开发——实战OC篇&环境搭建之StoryBoard(玩转UINavigationController与UITabBarController)
环境搭建之StoryBoard(玩转UINavigationController与UITabBarController) 研究了这么就IOS开发,都没有所处一个像样或者自己忙一点的项目.最近自 ...
- UIViewController、UINavigationController与UITabBarController的整合使用
UINavigationController与UITabBarController是iOS开发中最常用的两种视图控制器,它们都属于UIViewController的子类,继承关系如下: @interf ...
- UINavigationController和UITabBarController
UINavigationController和UITabBarController 目录 概述 UINavigationController UITabBarController 实用功能 待解决 概 ...
- 用代码生成UINavigationController 与UITabBarController相结合的简单QQ框架(部分)
首先我们需要搭建一个空的项目,当然xcode6.0以后不支持直接创建空项目,所以我们需要在系统生成项目之后,删除xcode自动给你生成的控制器和storyboard,另外需要在Main Interfa ...
- UINavigationController 与 UITabBarController
http://www.cnblogs.com/YouXianMing/p/3756904.html // index start from 1. UITabBarItem *newsItem = [[ ...
- UINavigationController 和 UITabBarController
UINavigationController当设置根控制器的时候,意思就是把根控制器压入栈内,当我们push的时候,我们把下一个控制器压入栈内,当我们pop的时候把上面的控制器的内存释放 UITa ...
随机推荐
- C#使用System.Data.SQLite操作SQLite
使用System.Data.SQLite 下载地址:http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki 得到Sy ...
- Linux下高并发socket链接数测试
一.如何增大service进程的max open files ulimit -n 只能改小max open files,不能改大.需要按照以下步骤: 修改/etc/security/limits.co ...
- asp.net 获取url
string url = Request.Url.ToString(); this.ImageLogo.ImageUrl = "http://" + Request.Url.Aut ...
- poj 1222 EXTENDED LIGHTS OUT(位运算+枚举)
http://poj.org/problem?id=1222 题意:给一个确定的5*6放入矩阵.每一个格子都有一个开关和一盏灯,0表示灯没亮,1表示灯亮着.让你输出一个5*6的矩阵ans[i][j], ...
- 一步步学习PHP笔记(李炎恢瓢城web俱乐部-多用户留言系统)01
本课:div+css实现首页效果: 开发工具:xampp + phpstorm 笔记目的:仅做记录使用,方便日后查看 代码目录结构: index.php: <?php define(" ...
- Getting NHibernate to generate a HiLo string ID
We've got a large system that's loosely bound to its data source (Navision) via Unity - we're gettin ...
- centos 安装http协议的git server
1.服务器端安装httpd,git,gitweb等 1 #yum install httpd git git-daemon gitweb 2.服务器端初始化仓库 1 2 3 #mkdir -p /d ...
- Sharepoint 列表ItemAdding事件判断文件类型、获取当前上传的文件
using System; using System.Security.Permissions; using Microsoft.SharePoint; using Microsoft.SharePo ...
- Docker 底层实现
基本架构 Docker 采用了 C/S架构,包括客户端和服务端. Docker daemon 作为服务端接受来自客户的请求,并处理这些请求(创建.运行.分发容器). 客户端和服务端既可以运行在一个机器 ...
- xml<>编译
< 用 < >用 > 表示"空格"