/**
* 配置公共的属性,该属性作用于所有的导航条界面;
*/
- (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. KesionCMS V6.5后台拿SHELL方法

    Title:KesionCMS V6.5后台拿SHELL方法  --2011-03-29 00:21 最近弄一个站点,是KesionCMS V6.5的WEB系统,试了下后台拿webshell方法,记下 ...

  2. spark1.1.0源码阅读-dagscheduler and stage

    1. rdd action ->sparkContext.runJob->dagscheduler.runJob def runJob[T, U: ClassTag]( rdd: RDD[ ...

  3. Android百度地图默认位置中心点设置

    //初始化地图    MapView mMapView = (MapView) findViewById(R.id.map); BaiduMap mBaidumap = mMapView.getMap ...

  4. Leetcode:Largest Number详细题解

    题目 Given a list of non negative integers, arrange them such that they form the largest number. For e ...

  5. #翻译# 深入JavaScript的Unicode难题(上)

    退一步说, JavaScript处理Unicode时有些怪异. 这篇文章会说明JS在Unicode上令人痛苦的部分, 然后提供解决方案, 并说明在未来的ECMAScript6中是如何改善这些问题的. ...

  6. 【剑指offer】面试题24:二叉搜索树的后序遍历序列

    题目: 输入一个整数数组,判断该数组是不是某二叉搜索树的后序遍历的结果.如果是则输出Yes,否则输出No.假设输入的数组的任意两个数字都互不相同. 思路: 递归 注意,主要就是假定数组为空时结果为fa ...

  7. HDU2196-Computer

    原题连接: http://acm.hdu.edu.cn/showproblem.php?pid=2196 思路: 好了,无敌了,经过昨晚4个钟头+今上午1个小时的奋战,这题终于被我AC了 收获的确是不 ...

  8. typedef与define的区别

    1) #define是预处理指令,在编译预处理时进行简单的替换,不作正确性检查,不关含义是否正确照样带入,只有在编译已被展开的源程序时才会发现可能的错误并报错.例如:#define PI 3.1415 ...

  9. arrayPointer

    1,分别使用指针加减 int wages[2] = {100000000,20000000}; int *pw = wages or int *pw = &wages[0] 表示指针指向数组的 ...

  10. zoj3422Go Deeper(2-sat + 二分)

    题目请戳这里 题目大意: go(int dep, int n, int m) begin output the value of dep. if dep < m and x[a[dep]] + ...