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开发中最牛 ...
随机推荐
- ASP.NET MVC4 学习系统四(视图)
视图(Views) 在ASP.NET MVC框架中,想要返回给用户HTML的控制器操作,就要返回ActionResult类型的ViewResult实例,ActionResult知道如何渲染应答结 ...
- file not found while xcode archive
今天碰到一个问题,就是我像在我的ios app中添加支付宝功能,按照文档我添加好了测试也成功,但是在archive的时候就是出问题,很奇怪.最后网上查了文档,最后在stackoverflow上面找到了 ...
- CSS3之弹性布局
flexbox是CSS3提出的页面布局模块.flexbox可以把列表横向或者纵向排列,并且填满可以延伸到的空间.稍微复杂的布局可以通过嵌套flex container来实现. 利用flexbox可以方 ...
- 【IHttpHandler】ASP.NET 生命周期
对由 Microsoft® Internet 信息服务 (IIS) 处理的 Microsoft® ASP.NET 页面的每个请求都会被移交到 ASP.NET HTTP 管道.HTTP 管道由一系列托管 ...
- Windows phone 8 学习笔记(6) 多任务(转)
Windows phone 8 是一个单任务操作系统,任何时候都只有一个应用处于活跃状态,这里的多任务是指对后台任务的支持.本节我们先讲讲应用程序的运行状态,然后看看支持的后台任务,包括:后台代理.后 ...
- webstorm & phpstorm破解
webstorm: http://idea.qinxi1992.cn/ http://idea.goxz.gq http://v2mc.net:1017 http://idea.imsxm.com h ...
- POJ C++程序设计 编程题#1 编程作业—多态与虚函数
编程题 #1 来源: POJ(Coursera声明:在POJ上完成的习题将不会计入Coursera的最后成绩.) 注意: 总时间限制: 1000ms 内存限制: 65536kB 下面程序的输出结果是: ...
- Sqlserver数据库存储路径的修改
Sqlserver数据库存储路径的修改 Sqlserver数据库存储路径问题:本系统sqlserver路径默认是存储在C盘目录下的,由于数据会慢慢变大和避免重装系统数据丢失等问题,最好手动将路径设置在 ...
- 浏览器内置Console函数使用详解
浏览器内置Console函数比较好用:Chrome 和 FireFox(Firebug插件) 利用此功能可以像直接在面板里面运行JS一样(写法不同而已) 一.显示信息的命令 Firebug内置一个co ...
- c# dataset 索引0没有值
datatable绑定到dataGrieView,在刷新datatable的数据时,常会bug:索引0没有值或索引(int)x没有值 昨天弄了一个下午,发现bug原因: dataGridView中有数 ...