UIScrollView scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(10, 20, 300, 130)]; scrollView.backgroundColor = [UIColor red...
分类:
其他好文 时间:
2015-03-16 12:50:22
阅读次数:
120
关于CALayer的疑惑首先CALayer是定义在QuartzCore框架中的CGImageRef、CGColorRef两种数据类型是定义在CoreGraphics框架中的UIColor、UIImage是定义在UIKit框架中的其次QuartzCore框架和CoreGraphics框架是可以跨平台使...
分类:
其他好文 时间:
2015-03-15 13:49:01
阅读次数:
106
NSFontAttributeName设置字体属性,默认值:字体:Helvetica(Neue) 字号:12NSForegroundColorAttributeName设置字体颜色,取值为 UIColor对象,默认值为黑色NSBackgroundColorAttributeName设置字体所在区域背...
分类:
其他好文 时间:
2015-03-13 15:58:47
阅读次数:
104
该文件可以引入一些全局通用的文件,这样就不用每次在文件中导入,也可以定义全局通用的变量或常量,如//定义NSString常量#define ServiceName @"cn.zmfc"//定义颜色#define BackgroudColor [UIColor colorWithRe...
分类:
其他好文 时间:
2015-03-12 16:37:59
阅读次数:
81
把UIColor(纯色值)对象转化成UIImage对象...
分类:
其他好文 时间:
2015-03-12 11:37:56
阅读次数:
115
UISwitch控件属性:1. onTintColor 处于on时switch 的颜色 switchImage.onTintColor = [UIColor grayColor];2.tintColor 处于off时switch 的颜色 switchImage.tintColor =...
分类:
其他好文 时间:
2015-03-12 00:50:13
阅读次数:
201
一、UISearchBar单独使用时,设置样式:UIView *view =[mySearchBar.subviews objectAtIndex:0]; // view.backgroundColor =[UIColor clearColor]; for (UIView *backview ...
分类:
移动开发 时间:
2015-03-04 16:12:23
阅读次数:
153
1. 大家都知道UITextField支持设置placeholder, 并且可以改变placeholder字体大小和颜色, 参照代码:
/* 设置placeholder*/
[textField setPlaceholder:@"placeholder in textField"];
/* 改变placeholder的颜色 */
[textField setValue:[UIColor...
分类:
其他好文 时间:
2015-03-03 18:40:21
阅读次数:
138
要获取上面的蓝色,用取色器取出的颜色又不对,怎么办?一句话就搞定了
UIColor *textColor = self.view.tintColor;...
分类:
移动开发 时间:
2015-03-03 16:43:57
阅读次数:
167
使用运行时库,必须要先引入 objc/runtime.h
看一个类别和动态添加属性的例子
UILabel+Associate.h
#import
@interface UILabel (Associate)
- (void) setFlashColor:(UIColor *) flashColor;
- (UIColor *) getFlashColor;
@end...
分类:
其他好文 时间:
2015-03-03 15:14:26
阅读次数:
141