iOS-系统自带navigationController-最全设置
// 导航栏背景色
self.navigationController.navigationBar.barTintColor = [UIColor orangeColor];
// 设置push出来的controller返回按钮的箭头颜色
[self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];
// 设置push出来的controller返回按钮字体及颜色
UIBarButtonItem *backItem=[[UIBarButtonItem alloc]init];
backItem.title=@"BBBACK";
[backItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor blueColor]} forState:UIControlStateNormal];
self.navigationItem.backBarButtonItem = backItem;
// 设置当前导航栏左右barbutton
UIBarButtonItem *leftBarbutton = [[UIBarButtonItem alloc] initWithTitle:@"左按钮" style:UIBarButtonItemStylePlain target:self action:@selector(action:)];
[leftBarbutton setTintColor:[UIColor blackColor]];
[leftBarbutton setImage:[UIImage imageNamed:@"icon57.png"]];
[leftBarbutton setTag:110];
UIBarButtonItem *rightBartutton = [[UIBarButtonItem alloc] initWithTitle:@"右按钮" style:UIBarButtonItemStylePlain target:self action:@selector(action:)];
[rightBartutton setTag:111];
[rightBartutton setTintColor:[UIColor whiteColor]];
self.navigationItem.rightBarButtonItem= rightBartutton;
self.navigationItem.leftBarButtonItem = leftBarbutton;
// 导航栏文字颜色
//UIView *navView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 50, 30)];
//[navView setBackgroundColor:[UIColor whiteColor]];
//[self.navigationItem setTitleView:navView];
[self.navigationItem setTitle:@"主页"];
[self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor redColor]}];
// 视图坐标从导航栏高度开始
[self.navigationController.navigationBar setTranslucent:NO];
// 添加一个导航栏
UINavigationBar *navigationBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 70)];
UINavigationItem *navigationItem = [[UINavigationItem alloc] initWithTitle:@"首页"];
[navigationBar pushNavigationItem:navigationItem animated:NO];
UIBarButtonItem *pushBarButton = [[UIBarButtonItem alloc] initWithTitle:@"左按钮" style:UIBarButtonItemStylePlain target:self action:@selector(push:)];
[pushBarButton setTintColor:[UIColor blackColor]];
[pushBarButton setImage:[UIImage imageNamed:@"icon57.png"]];
navigationItem.rightBarButtonItem = pushBarButton;
[self.view addSubview:navigationBar];
// 设置其字体颜色和背景色
[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor redColor]}];
[[UINavigationBar appearance] setBarTintColor:[UIColor whiteColor]];
iOS-系统自带navigationController-最全设置的更多相关文章
- iOS系统自带的 UIAlertView 自动旋转的实现
这里主要解析 UIAlertView 的几个关键功能的实现: 随着设备屏幕的旋转而旋转: Alert弹出框,使用UIWindow来实现,就是说,不用依赖于当前显示在最前面的UIView. 实现源码参考 ...
- iOS系统自带分享功能
很多APP中都带有社交分享功能,通过用户的分享,让更多地人去了解和使用这个APP,目前社交分享是移动互联网应用程序推广的最重要手段之一,国内较或的分享平台有微信,IOS6后苹果集成的新浪微博,还有IO ...
- 社交网络编程API之iOS系统自带分享
社交网络编程API 社交网络编程主要使用iOS提供的Social框架,目前Social框架主要包含两个类: SLComposeViewController 提供撰写社交信息(如微博信息)的视图控制器, ...
- Android之系统自带的文字外观设置及实际显示效果图
android:textAppearance xml布局里面设置文字的外观: 如“android:textAppearance=“?android:attr/textAppearanceLargeI ...
- 利用UIActivityController调用ios系统自带的分享功能,实现微信发布多图的功能
通过一番查找以后找到一个类UIActivityController,可以调用系统的social.framework中的分享接口.看下面的图就知道了,这个还是挺常见的 微信发布多图 借鉴了CSDN上的一 ...
- iOS系统自带正则表达式简单运用
//组装一个字符串,把里面的网址解析出来 NSString *urlString = @"sfdshttp://www.baidu.com"; NSError *error; // ...
- Ios二维码扫描(系统自带的二维码扫描)
Ios二维码扫描 这里给大家介绍的时如何使用系统自带的二维码扫描方法和一些简单的动画! 操作步骤: 1).首先你需要搭建UI界面如图:下图我用了俩个imageview和一个label 2).你需要在你 ...
- Android中实现全屏、无标题栏的两种办法(另附Android系统自带样式的解释)
在进行UI设计时,我们经常需要将屏幕设置成无标题栏或者全屏.要实现起来也非常简单,主要有两种方法:配置xml文件和编写代码设置. 1.在xml文件中进行配置 在项目的清单文件AndroidManife ...
- Android调用系统自带的设置界面
Android有很多系统自带的设置界面,如设置声音,设置网络等. 在开发中可以调用这些系统自带的设置界面. 点击以下列表中的选项,就可以调出相应的系统自带的设置界面. 如点击“无线和网络设置”,可以调 ...
- iOS开发——运行时OC篇&使用运行时获取系统的属性:使用自己的手势修改系统自带的手势
使用运行时获取系统的属性:使用自己的手势修改系统自带的手势 有的时候我需要实现一个功能,但是没有想到很好的方法或者想到了方法只是那个方法实现起来太麻烦,一或者确实为了装逼,我们就会想到iOS开发中最牛 ...
随机推荐
- CSS 三角形绘制方法
#triangle-up { width: 0; height: 0; border-left: 50px solid transparent; border-right: 5 ...
- 添加favicon.ico网站文件
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" me ...
- 设计模式-观察者模式(Observer)
简介: 观察者模式,也称为订阅-发布模式,定义对象间的一种一对多的依赖关系,当一个对象的状态发生变化时,所有依赖他的对象都得到通知并被自动更新. 主要由以下几个部分组成: a.Subject目标对象. ...
- 【风马一族_C】c语言版,在2到n中寻找出所有的素数
#include <iostream> #include <stdio.h> #include <math.h> /* run this program using ...
- 快速清理Visual Studio起始页最近打开项目
清除vs2008起始页最近打开项目 第一种:最简单的方式: 把以下内容保存为.bat批处理文件 @echo off@REG Delete HKCU\Software\Microsoft\VisualS ...
- Winform下WebBrowser 编辑模式 监听键盘按键事件
最近使用 WebBrowser 做了个富文本编辑器(其实网上有很多很多).例如下面这个玩意(不要在意界面神马的) WebBrowser在编辑模式下可以有一些HTML标签的功能,改变字体大小颜色等等等. ...
- Java基本开发环境搭建(适合第一次使用)
Java基本开发环境搭建(适合第一次使用) 编写人:cc 阿爸 2013-10-17 一.开发工具获取 1.开发工具包JDK l 下载地址: 到ORACLE公司官方网站(http://www.ora ...
- php变量那些事:php引擎对变量声明、存储简要分析(ZVAL)
php中变量有三个基本的特性: 1.变量符号.也就是变量的名称.形象比喻,kv中的key.这个有php引擎的符号表(hash表)管理. 2.变量类型.一个php变量可以是boolean.integer ...
- php框架学习的步骤
一,选择一个合适的php框架 在国内,使用zf,ci和tp框架的人比较多,新手可以从中选一个去学习,新手不建议一开始就去学习zf,功力还不够深,学习zf会让你更迷茫. 二,选定一个php框架之后,如何 ...
- windows下编译lua源码
所有的lua源码都放在了 src 文件夹下,当然,不同的lua版本目录结构有可能不一样,但是都会有 src 这个文件夹,只有这个才是我们编译必须的.而且lua越做越精简了,5.1的版本里面还有一些te ...