簡單的陰影實現

- (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.
}
相關文章
相關標籤/搜索