111、为什么在 IB 中设置 layer.borderColor 无用?我在 IB 中通过设置 UIView 的Runtime 属性,以获得一个圆角带红色边框的矩形效果,如下图所示:但是,borderColor 属性似乎是无效的,边框无法显示。layer.borderColor 是一个 CGColorRef 属性,而 Runtime 属性的颜色面板中得到的只能是 UIColor 属性,因此你无法...
分类:
移动开发 时间:
2015-01-23 13:30:46
阅读次数:
181
mainTableView.sectionIndexBackgroundColor = [UIColor greenColor];//修改右边索引的背景色// mainTableView.sectionIndexColor = [UIColor orangeColor];//修改右边索引字体的...
分类:
其他好文 时间:
2015-01-23 13:10:39
阅读次数:
372
1.产生随机颜色:-(UIColor *)randomColor{ //产生随机颜色 static BOOL seed = NO; if (!seed) { seed = YES; srandom(time(NULL)); } CGFloat red = (CGFloat)ran...
分类:
其他好文 时间:
2015-01-22 21:45:21
阅读次数:
201
改变textfield 的placeholder的大小方法: [_nameTextField setValue:[UIFont boldSystemFontOfSize:5] forKeyPath:@"_placeholderLabel.font"];
[_nameTextField setValue:[UIColor redColor] forKeyPath:@"_placeholderLab...
分类:
其他好文 时间:
2015-01-20 12:08:39
阅读次数:
194
//创建分段按钮 UISegmentedControl *segment = [[UISegmentedControl alloc] initWithFrame:CGRectMake(100, 200, 100, 50)]; //设置Item的宽度 UIColor *MyTint = [[UI...
分类:
移动开发 时间:
2015-01-16 20:37:14
阅读次数:
151
[self.navigationController.navigationBar setShadowImage:[Static ColorToImage:[Static colorWithHexString:[UIColor red]]]];Static 里的几个静态方法+ (UIImage *)C...
分类:
其他好文 时间:
2015-01-16 18:25:26
阅读次数:
146
//创建层 CALayer *layer5=[CALayer layer]; //设置层背景 layer5.backgroundColor=[[UIColor brownColor]CGColor]; //设置大小 layer5.bounds=CGRectMake(200, 200, 2...
分类:
其他好文 时间:
2015-01-15 18:04:38
阅读次数:
145
传统的设置if (IOSVERSION >= 7) { [[UINavigationBar appearance] setBarTintColor:[UIColor redColor]];} else { [[UINavigationBar appearance] setBarTi...
分类:
其他好文 时间:
2015-01-15 15:45:32
阅读次数:
177
最近的一个项目有一个聊天模块,需要对联系人列表右侧标题栏标题颜色做修改,系统默认颜色如下 修改后只需在初始化tableView后做如下操作:tableView.sectionIndexBackgroundColor = [UIColor clearColor];tabelView.sectionIn...
分类:
其他好文 时间:
2015-01-09 12:01:12
阅读次数:
139
- (void)setTitle:(NSString *)title forState:(UIControlState)state;//设置标题- (void)setTitleColor:(UIColor *)color forState:(UIControlState)state;//设置标题颜色...
分类:
移动开发 时间:
2015-01-08 22:31:28
阅读次数:
386