现在的位置: 首页 > 综合 > 正文

设置边框效果和阴影层

2013年08月21日 ⁄ 综合 ⁄ 共 387字 ⁄ 字号 评论关闭

边框效果:

//_myImageView边框效果
  CALayer *layer = [_myImageView layer];
  [layer setCornerRadius:10];
  [layer setMasksToBounds:YES];//设置边框可见
  layer.borderColor = [[UIColor yellowColor] CGColor];
  [layer setBorderWidth:1];
  [control addSubview:_myImageView];

阴影层:

CALayer *layer = [imageView layer];
layer.shadowOffset = CGSizeMake(0, 3);
layer.shadowRadius = 5.0;
layer.shadowColor = [UIColor blackColor].CGColor;
layer.shadowOpacity = 0.8;

抱歉!评论已关闭.