/**
* 配置公共的属性,该属性作用于所有的导航条界面;
*/
- (void)configureConmmonPropety {
//1.设置导航条的颜色
self.navigationController.navigationBar.barTintColor = [UIColor yellowColor];
//2.关闭导航条的毛玻璃效果.
self.navigationController.navigationBar.translucent = NO;
//3.隐藏导航条
self.navigationController.navigationBar.hidden = NO;
//4.设置导航条内容的渲染颜色
self.navigationController.navigationBar.tintColor = [UIColor purpleColor]; //5.设置导航条的背景图片.
//图片尺寸不一样,显示的效果是不同的;(一定要非常严格)
// [self.navigationController.navigationBar setBackgroundImage:<#(UIImage *)#> forBarMetrics:<#(UIBarMetrics)#>]; //6.设置导航条标题文字的大小和颜色
NSDictionary *dic = @{NSFontAttributeName:[UIFont boldSystemFontOfSize:],
NSForegroundColorAttributeName:[UIColor redColor]
};
self.navigationController.navigationBar.titleTextAttributes = dic; } /**
* 针对当前一个界面单独定制导航条内容
*/
- (void)customizedNavigationBarContent {
//配置导航条上显示的标题
self.navigationItem.title = @"第一个界面";
//配置导航条的标题视图
UISegmentedControl *segment = [[UISegmentedControl alloc] initWithItems:@[@"国家", @"地区"]];
self.navigationItem.titleView = segment;
[segment release];
//配置左边内容,显示废纸篓按钮
UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemTrash target:self action:@selector(handleTrash:)];
self.navigationItem.leftBarButtonItem = leftItem;
[leftItem release];
//配置右边内容
UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(handleAdd:)];
self.navigationItem.rightBarButtonItem = rightItem;
[rightItem release]; }

//在对navigationBar进行设置时,比如添加一个scrollView,系统会自动将ScrollView下移偏离TOP 64个像素点,为了避免这样,我们有两种方法:

1.将navigationBar的毛玻璃效果关闭;

2.将navigationBar的属性automaticallyAdjustsScrollViewInsets = NO;

<后续补充,今天只学了个皮毛>.

iOS学习之导航条NavigationControl的一些属性设置的更多相关文章

  1. iOS 状态栏和导航条配置

    iOS 状态栏和导航条配置 一:隐藏: [self.navigationController setNavigationBarHidden:YES animated:YES]; [[UIApplica ...

  2. bootstrap基础学习【导航条、分页导航】(五)

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  3. iOS学习——更改导航栏的返回按钮的标题与颜色

    转载自:修改navigationController返回按钮颜色和文字 今天在做项目时遇到这个问题,试了很多方法都失败了.最后终于找到正确的方案了,在这里分享给大家. 引言 在iOS开发过程中,Nav ...

  4. iOS改变UINavigationBar导航条标题颜色和字体

    转自:http://www.2cto.com/kf/201311/260409.html iOS 5 以后 UINavigationController 可以 改变UINavigationBar导航条 ...

  5. 模拟iOS系统原生导航条隐藏或显示动画

    借UIView动画,使更改导航条的hidden属性这一过程动起来.悦德财富:https://yuedecaifu.com 代码 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...

  6. iOS viewController添加导航条以及返回跳转选择

    给单独的viewcontroller或者在Appdelegate的主页面添加导航条,只要在viewcontroller上添加navigationcontroller,在添加此navigationcon ...

  7. iOS学习-圆形进度条

    效果: #import <UIKit/UIKit.h> @interface HsProfitRatePieWidgets : UIView { UILabel *_textLabel; ...

  8. IOS学习笔记2—Objective C—类、属性、方法

    以下是我学习IOS开发的一些笔记和心得,贴出来和大家一同分享,也希望大家能补充和纠错,共同进步 有Android和IOS开发问题也希望能和大家交流! Objective-C 1.OC是一门基于C的面向 ...

  9. iOS学习之应用数据存储1-属性列表、偏好设置、NSKeyedArchiver归档

    iOS应用数据存储的常用方式(持久化方式) 属性列表(plist)归档(XML文件) Preference(偏好设置) NSKeyedArchiver归档(NSCoding) SQLite3 Core ...

随机推荐

  1. 64位linux中使用inet_ntoa报错处理

    最近一直使用linux mint 15,我用的是64位操作系统,在进行网络编程的时候,发现一个问题,请看源码: /*get_ip_by_name.c*/ #include <stdio.h> ...

  2. 读UNDO引发的db file sequential read

    SQL> select * from (select SESSION_ID, NAME, P1, P2, P3, WAIT_TIME, CURRENT_OBJ#, CURRENT_FILE#, ...

  3. FILTER的执行次数和驱动表问题

    drop table test1; create table test1 as select * from dba_objects where rownum<1000; drop table t ...

  4. 在ubuntu上编译chrome

    在ubuntu上编译chrome 在ubuntu上编译chrome 红心地瓜 1.获取代码 1)下载tarball,http://chromium-browser-source.commondatas ...

  5. LibCurl编程手册以及代码实例

    1. LibCurl编程流程 在基于LibCurl的程序里,主要采用callback function (回调函数)的形式完成传输任务,用户在启动传输前设置好各类参数和回调函数,当满足条件时libcu ...

  6. 关于XMLEncoder和XMLDecoder

    我们用XMLEncoder和XMLDecoder来序列化和反序列化一个类. 我觉得需要注意的是,我们在new一个对象的时候,XMLEncoder本身默认的是类中无参的构造函数,我今儿在实现的时候,老是 ...

  7. linux权限及ntfs文件系统权限的知识

    关于ntfs权限的问题 文件的权限: [-dcbps][u:rwx][g:rwx][a:rwx] 当中: r=4, w=2, x=1,  u=owner, g=group, a=all user   ...

  8. Mapreduce运行过程分析(基于Hadoop2.4)——(一)

    1 概述 该瞅瞅MapReduce的内部执行原理了,曾经仅仅知道个皮毛,再不搞搞,不然怎么死的都不晓得.下文会以2.4版本号中的WordCount这个经典样例作为分析的切入点.一步步来看里面究竟是个什 ...

  9. 菜鸟玩云计算之十六:Ubuntu14.04上创建的虚拟机迁移到RHEL6.4

    菜鸟玩云计算之十六:Ubuntu14.04上创建的RHEL6.4虚拟机迁移到RHEL6.4主机上 RHEL6.4 Server作为虚拟机的HOST,执行以下的命令检查配置和安装相关软件: # egre ...

  10. 把Nginx加入系统服务 service nginx (start | stop | restart | reload)

    vim /etc/init.d/nginx 1 #!/bin/bash  2 # nginx Startup script for the Nginx HTTP Server  3 # it is v ...