iOS系统navigationBar背景色,文字颜色处理
- (void)setRightBarButtonItem
{
// Create done Button
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc]initWithTitle:[NSString stringWithFormat:@"确定(%lu/%lu)", (unsigned long)self.selectedAssetURLs.count, (unsigned long)self.maximumNumberOfSelection] style:UIBarButtonItemStylePlain target:self action:@selector(done:)]; [self.navigationItem setRightBarButtonItem:doneButton animated:YES]; UIColor *color = [UIColor colorWithHexString:@"#fe5346"];
CGRect frame = CGRectMake(, , SCREEN_WIDTH, );
UIImage *image = [UIImage imageWithColor:color withFrame:frame];
[self.navigationController.navigationBar setBackgroundImage:image forBarMetrics:UIBarMetricsDefault];
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
self.navigationController.navigationBar.barTintColor = [UIColor whiteColor];
self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor whiteColor]}; }
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
/**
* @author SongXing, 15-07-30 14:07:45
*
* UIIMagePickerController颜色修正
*
*/
if ([navigationController isKindOfClass:[UIImagePickerController class]] &&
((UIImagePickerController *)navigationController).sourceType == UIImagePickerControllerSourceTypePhotoLibrary) {
[[UIApplication sharedApplication] setStatusBarHidden:NO];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:NO];
} if (navigationController.viewControllers.count != ) return; CGFloat screenHeight = [[UIScreen mainScreen] bounds].size.height; UIView *plCropOverlay = [viewController.view.subviews[] subviews][]; plCropOverlay.hidden = YES; int position = ; position = (screenHeight == ) ? : ; CAShapeLayer *circleLayer = [CAShapeLayer layer]; UIBezierPath *path2 = [UIBezierPath bezierPathWithOvalInRect:
CGRectMake(0.0f, position, SCREEN_WIDTH, 320.0f)];
[path2 setUsesEvenOddFillRule:YES]; [circleLayer setPath:[path2 CGPath]]; [circleLayer setFillColor:[[UIColor clearColor] CGColor]];
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(, , SCREEN_WIDTH, screenHeight-) cornerRadius:]; [path appendPath:path2];
[path setUsesEvenOddFillRule:YES]; CAShapeLayer *fillLayer = [CAShapeLayer layer];
fillLayer.path = path.CGPath;
fillLayer.fillRule = kCAFillRuleEvenOdd;
fillLayer.fillColor = [UIColor clearColor].CGColor;
fillLayer.opacity = 0.8;
[viewController.view.layer addSublayer:fillLayer]; }
iOS系统navigationBar背景色,文字颜色处理的更多相关文章
- iOS导航栏背景,标题和返回按钮文字颜色
在iOS7下,默认导航栏背景,颜色是这样的,接下来我们就进行自定义,如果你仅仅是更改一下背景和颜色,代码会很简单,不需要很复杂的自定义View来替代leftBarItem 更改导航栏的背景和文字Col ...
- 解决win10系统dpi放大后,部分网页文字颜色很浅的问题
前段时间,换了个27寸的4k显示器.原始分辨率下文字太小,眼睛估计得看瞎 放大dpi后,这问题,那问题,好多 百度知道,淘宝,这网页文字颜色也非常的浅,看着眼睛很累人 看了半天是字体若的祸 暂时发现A ...
- android TextView 设置部分文字背景色和文字颜色
通过SpannableStringBuilder来实现,它就像html里边的元素改变指定文字的文字颜色或背景色 public class MainActivity extends Activity { ...
- android TextView 设置部分文字背景色 和 文字颜色
通过SpannableStringBuilder来实现,它就像html里边的元素改变指定文字的文字颜色或背景色 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ...
- 修改Tooltip 文字提示 的背景色 箭头颜色
3==>vue 鼠标右击<div @contextmenu.prevent="mouseRightClick">prevent是阻止鼠标的默认事件 4==> ...
- 【Winform-GataGridView】根据DataGridView中的数据内容设置行的文字颜色、背景色 — 根据状态变色
C#中可以根据每行内容的不同来对DataGridView数据表格控制每行的文字颜色.背景颜色进行不同的设置. 效果如下: 实现: 在DataGridView的RowPrePaint事件中进行行颜色控制 ...
- iOS不得姐项目--登录模块的布局,设置文本框占位文字颜色,自定义内部控件竖直排列的按钮
一.登录模块的布局 将一整部分切割成若干部分来完成,如图分成了三部分来完成 设置顶部状态栏为白色的方法 二.设置文本框占位文字颜色 <1>方法一与方法二实现原理是同一种,都是通过设置pla ...
- iOS tableview 选中Cell后的背景颜色和文字颜色
做下记录,备忘 改文字颜色其实是UILabel的属性,改背景颜色是cell的属性,都和tableview无关. cell.textLabel.textColor = BAR_COLOR; cell.t ...
- iOS开发,更改状态栏(StatusBar)文字颜色为白色
详细实现步骤 1.如图在Info.plist中进行设置,主要用于处理启动画面中状态栏(StatusBar)文字颜色. watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5u ...
随机推荐
- C语言 数组做函数参数不传数组个数的遍历方法
//数组做函数参数不传数组个数的遍历方法 #include<stdio.h> #include<stdlib.h> #include<string.h> void ...
- Go视频教程整理
[Go Web基础]01博客项目设计 |Go视频教程|Go语言基础 http://www.tudou.com/programs/view/gXZb9tGNsGU/ [Go Web基础]02初窥 Web ...
- 利用Chrome插件向指定页面植入js,劫持 XSS
资源来自:http://www.2cto.com/Article/201307/225986.html 首页 > 安全 > 网站安全 > 正文 利用Chrome插件向指定页面植入js ...
- 教你怎么fan qiang 进国内看视频而不受限制
这一周难得今天闲一点,写日志也不知道写啥,谈爱情?...没得谈.思前想后还是在这儿带给大家点福利吧,主要是针对在国外生活的孩纸们看国内视频总是提示被限制的问题,qq音乐也是. 或许大家有听过f ...
- 记录毕业论文 LanguageTool 二次开发时用到的网站
LanguageTool Development LanguageTool Supported Languages Share your knowledge about LT - LanguageTo ...
- swift项目实战FoodPin目录
好吧,据说写博客能够找到好工作,那我也来分享一个项目吧! 自己自学iOS开发也有半年多了,现在就来分享一个swift的小项目吧!这个项目的来源是<Beginning iOS8 programmi ...
- EF实体框架之CodeFirst四
在EF实体框架之CodeFirst二中也提到数据库里面一般包括表.列.约束.主外键.级联操作.实体关系(E-R图).存储过程.视图.锁.事务.数据库结构更新等.前面几篇博客把表.存储过程.视图这些算是 ...
- 第六章 prototype和constructor
首先我们看下面一段代码(第六章 01.htm) function myfun() //定义一个函数myfun { }; console.log(typeof (myfun.prototype)); c ...
- [bzoj 1503][NOI 2004]郁闷的出纳员(平衡树)
题目:http://www.lydsy.com/JudgeOnline/problem.php?id=1503 分析: 经典的平衡树题,我用Treap做的 下面有几点注意的: 1.可能出现新加入的人的 ...
- C#线程模型脉络
今天在看同事新买到的<C#本质论 Edition 4>的时候,对比下以前Edtion3的新特性时针对Async/Await关键字时发现对一些线程方面的定义还理解的不是很透彻,脉络还不是很清 ...