iOS 代码生成阴影边框

如图效果

  • 周围扩散阴影

 代码

    self.bg2.layer.shadowColor = color.CGColor;
    self.bg2.layer.shadowOffset = CGSizeMake(0,8);//阴影扩散范围
    self.bg2.layer.shadowOpacity = 1.0;
    self.bg2.layer.shadowRadius = 29;
    self.bg2.layer.cornerRadius = 25;

    self.bg2.backgroundColor = [UIColor whiteColor];
    self.bg2.clipsToBounds = NO;

猜你喜欢

转载自blog.csdn.net/hezhi66327/article/details/128627093
今日推荐