IOS中如果使用RGB实现背景色
生活随笔
收集整理的這篇文章主要介紹了
IOS中如果使用RGB实现背景色
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
在開發的過程中、我們往往會碰到圖片很多的情況、這時候我們的程序打包就會變得很大、一些純色的圖片可以用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实现背景色的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: reactor模式:主从式reactor
- 下一篇: 通过httplib2 探索的学习的最佳方