简单的阴影实现

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"阴影";
    
    _shadowView.layer.masksToBounds = NO;
    _shadowView.layer.cornerRadius = 8;
    _shadowView.layer.shadowColor = [UIColor grayColor].CGColor;
    _shadowView.layer.shadowOffset = CGSizeMake(-5, -5);//(-5, -5)>>x向左偏移5,y向上偏移5
    _shadowView.layer.shadowRadius = 3;//阴影半径
    _shadowView.layer.shadowOpacity = 0.9;//阴影透明度
//    _shadowViewx.layer.shadowPath = [UIBezierPath bezierPathWithRect:_shadowView.bounds].CGPath;
    // Do any additional setup after loading the view from its nib.
}
相关文章
相关标签/搜索