layer属性

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

// 设置圆角边缘
   
self .image.layer.masksToBounds = YES ;

   
self .image.layer.cornerRadius = 150 ;(宽度和高的一半)
   
// 边框宽度
   
self .image.layer.borderWidth = 3 ;
   
// 边框颜色
    self.image.layer.borderColor = [UIColor orangeColor].CGColor;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值