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开发中最牛 ...
随机推荐
- typedef 与define 的区别
typedef和#define的用法与区别 typedef和#define的用法与区别 一.typedef的用法 在C/C++语言中,typedef常用来定义一个标识符及关键字的别名,它是语言编译 ...
- Windows7:Visual Studio 2008试用版的评估期已经结束解决方法
Windows7:Visual Studio 2008试用版的评估期已经结束解决方法 以前在Windows2003碰到这个问题时,都是到"控制面板→添加或删除程序"选择 ...
- C#之泛型
泛型是C# 2.0版本才有的语言特性,是具有参数类型占位符的类.结构.接口和方法.这些占位符是类.结构.接口和方法所存储或使用的一个或多个占位符.简单来说,就是变量类型的参数化. 以下是详细demo: ...
- LAMP+LNMP视频教程
你是否在LAMP或是LNMP源码编译的道路上走过弯路,失败过或者目前还没有顺利安装过呢?另外网上有网上有很多LAMP/LNMP的一键安装脚本,如果拿过来直接用还是要改脚本.本教程的内容就能帮助你解决手 ...
- Oracle:使用过程中的问题集锦
导读:在使用Oracle的过程中,又频繁的出问题.突然间就连接不上,各种报错了.在此,将问题给记录下来,方便以后查看. 一.ora 12514监听程序当前无法识别 之前一直链接使用的好好的,突然就连接 ...
- part 设置
RCC_AHBENR 中的17.18.19.20. 分别是PORTA,PORTB.PORTC.PORTD 的时钟使能控制位,要A.B.C.D 端口有效,置位. 如: RCC -> AHBENR ...
- No valid host was found. There are not enough hosts available
- AX 获得当前Grid的数据源的记录行数
sysQuery::CountTotal();方法 eg: int lines = sysQuery::CountTotal( SalesTable_ds.QueryRun());
- 尝试自己建立以alpine 为基础的docker基础镜像和组件镜像
安装ubuntu14.04 然后 #获取root权限 sudo su #安装docker apt-get install docker #准备基础镜像 docker pull alpine docke ...
- PayPal 开发详解(七):运行REST API SAMPLE
1.编译成功,修改配置文件 sdk_config.properties ,使用我们申请的测试帐号执行收款测试,clientId 和 clientSecret 参见 PayPal 开发详解(五) 2.将 ...