self.backView = [[UIView alloc] initWithFrame:CGRectMake(15, CGRectGetMaxY(self.withdrawButton.frame) + 15, WIDTH - 30, 60)];
self.backView.backgroundColor = [UIColor whiteColor];
self.backView.layer.cornerRadius = 5;
self.backView.layer.shadowColor = IWColor(238, 238, 238).CGColor;
self.backView.layer.shadowOffset = CGSizeMake(2, 5);
self.backView.layer.shadowOpacity = 0.5;
[self.view addSubview:self.backView];
1.首先排查控件加背景色没有,就是上列代码中的:self.backView.backgroundColor = [UIColor whiteColor];
2.我们经常在切圆角会用一个属性就是layer.masksToBounds,在添加阴影时候masksToBounds这个属性不能用的,官方说:masksToBounds为NO的情况下才能有动画(Defaults to NO Animatable)。把masksToBounds设为NO即可:self.backView.layer.masksToBounds = NO;