- layer.backgroundColor = [UIColor cyanColor].CGColor; // 给图层添加背景色
- layer.contents = (id)[UIImage imageNamed:@"view_BG.png"].CGImage; // 给图层添加背景图片
- layer.cornerRadius = 8; // 将图层的边框设置为圆脚
- layer.masksToBounds = YES; // 隐藏边界
- layer.borderWidth = 5; // 给图层添加一个有色边框
- layer.borderColor = [UIColor colorWithRed:0.52 green:0.09 blue:0.07 alpha:1].CGColor;
- layer.shadowOffset = CGSizeMake(0, 3); // 设置阴影的偏移量
- layer.shadowRadius = 10.0; // 设置阴影的半径
- layer.shadowColor = [UIColor blackColor].CGColor; // 设置阴影的颜色为黑色
- layer.shadowOpacity = 0.9; // 设置阴影的不透明度
//
设置圆角边缘
self .image.layer.masksToBounds = YES ;
self .image.layer.cornerRadius = 150 ;(宽度和高的一半)
// 边框宽度
self .image.layer.borderWidth = 3 ;
// 边框颜色
self .image.layer.masksToBounds = YES ;
self .image.layer.cornerRadius = 150 ;(宽度和高的一半)
// 边框宽度
self .image.layer.borderWidth = 3 ;
// 边框颜色
self.image.layer.borderColor = [UIColor orangeColor].CGColor;