iOS学习之导航条NavigationControl的一些属性设置
/**
* 配置公共的属性,该属性作用于所有的导航条界面;
*/
- (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的一些属性设置的更多相关文章
- iOS 状态栏和导航条配置
iOS 状态栏和导航条配置 一:隐藏: [self.navigationController setNavigationBarHidden:YES animated:YES]; [[UIApplica ...
- bootstrap基础学习【导航条、分页导航】(五)
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- iOS学习——更改导航栏的返回按钮的标题与颜色
转载自:修改navigationController返回按钮颜色和文字 今天在做项目时遇到这个问题,试了很多方法都失败了.最后终于找到正确的方案了,在这里分享给大家. 引言 在iOS开发过程中,Nav ...
- iOS改变UINavigationBar导航条标题颜色和字体
转自:http://www.2cto.com/kf/201311/260409.html iOS 5 以后 UINavigationController 可以 改变UINavigationBar导航条 ...
- 模拟iOS系统原生导航条隐藏或显示动画
借UIView动画,使更改导航条的hidden属性这一过程动起来.悦德财富:https://yuedecaifu.com 代码 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...
- iOS viewController添加导航条以及返回跳转选择
给单独的viewcontroller或者在Appdelegate的主页面添加导航条,只要在viewcontroller上添加navigationcontroller,在添加此navigationcon ...
- iOS学习-圆形进度条
效果: #import <UIKit/UIKit.h> @interface HsProfitRatePieWidgets : UIView { UILabel *_textLabel; ...
- IOS学习笔记2—Objective C—类、属性、方法
以下是我学习IOS开发的一些笔记和心得,贴出来和大家一同分享,也希望大家能补充和纠错,共同进步 有Android和IOS开发问题也希望能和大家交流! Objective-C 1.OC是一门基于C的面向 ...
- iOS学习之应用数据存储1-属性列表、偏好设置、NSKeyedArchiver归档
iOS应用数据存储的常用方式(持久化方式) 属性列表(plist)归档(XML文件) Preference(偏好设置) NSKeyedArchiver归档(NSCoding) SQLite3 Core ...
随机推荐
- 转:memcpy的用法总结
1.memcpy 函数用于 把资源内存(src所指向的内存区域) 拷贝到目标内存(dest所指向的内存区域):拷贝多少个?有一个size变量控制拷贝的字节数:函数原型:void *memcpy(voi ...
- Calling a Web API From a .NET Client (C#)
on|January 20, 2014 1760 of 2013 people found this helpful Print Download Completed Project This tut ...
- CCF 送货 + 欧拉路模板
#include <bits/stdc++.h> using namespace std; stack<int> st; vector<]; ][]; ],cp[]; i ...
- Python NTLK资料
1.Creating a new corpus with NLTK http://stackoverflow.com/questions/4951751/creating-a-new-corpus-w ...
- SOFTWARE_INTRODUCE_01
&amp;amp;amp;lt;br data-mce-bogus="1"&amp;amp;amp;gt;&amp;amp;amp; ...
- 【C#基础】CSA控件编写秘籍
新建CSA控件 1.新建一个纯类,命名空间是: namespace SimPerfect.CSAControlLibrary.CSAControls 2.实现两个构造函数:无参和传Candy参数 pu ...
- oracle递归函数
oracle start with connect by 使用方法 oracle中 connect by prior 递归算法 Oracle中start with...connect by prio ...
- 学习设计模式--观察者模式(C++)
1. 说说简单的函数回调 首先说说一种简单的函数回调机制(一种通过获取对象的指针来进行函数的调用方法)以下是代码演示--- 这是观察者(被回调)部分: class Observer { public: ...
- c#中从string数组转换到int数组
以前一直有一个数组之间转换的东西,可是忘记了,今天也是找了好久也没有解决,最后用这种方法解决了,分享给大家. " }; int[] output = Array.ConvertAll< ...
- Java可见性机制的原理
基本概念 可见性 当一个线程修改了共享变量时,另一个线程可以读取到这个修改后的值. 内存屏障(Memory Barriers) 处理器的一组指令,用于实现对内存操作的顺序限制. 缓冲行 CPU告诉缓存 ...