首页 > 移动平台 > 详细

IOS中如果使用RGB实现背景色

时间:2015-10-14 17:19:20      阅读:311      评论:0      收藏:0      [点我收藏+]

在开发的过程中、我们往往会碰到图片很多的情况、这时候我们的程序打包就会变得很大、一些纯色的图片可以用RGB来实现、这样可以减少内存的占用MAC本中有数码测色计这个功能、通过这个我们可以获得图片的RGB、

 

#import <UIKit/UIKit.h>

@interface UIColor (Pattern)

+ (UIColor *)wqd_mainColor;

+ (UIColor *)wqd_viewColor;

@end

#import "UIColor+Pattern.h"

@implementation UIColor (Pattern)
+ (UIColor *)wqd_mainColor{
    return  [UIColor colorWithRed:0/255.0 green:91/255.0 blue:255/255.0 alpha:1.0];
}

+ (UIColor *)wqd_viewColor{
    return [UIColor colorWithRed:245/255.0 green:245/255.0 blue:245/255.0 alpha:1.0];
}
@end

 

使用的时候直接包含头文件 调用类方法就行

 [[UINavigationBar appearance]setBarTintColor:[UIColor wqd_mainColor]];

IOS中如果使用RGB实现背景色

原文:http://www.cnblogs.com/er-dai-ma-nong/p/4877635.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!