UILabel 修改阴影面积

2018-06-06  本文已影响5人  今年27
- (void)setTitleSoftShadowColor:(UIColor *)color offset:(CGSize)offset {
    //阴影层的扩散半径
    self.titleLabel.layer.shadowRadius = 5.0f;
    //阴影层的透明度
    self.titleLabel.layer.shadowOpacity = 1.0;
    //阴影层的颜色,设为已存的颜色
    self.titleLabel.layer.shadowColor = color.CGColor;
    //阴影层的偏移,设为已存的偏移
    self.titleLabel.layer.shadowOffset = offset;
    self.titleLabel.layer.masksToBounds = NO;
}
上一篇下一篇

猜你喜欢

热点阅读