[alertSquare.layer setShadowColor:[UIColor blackColor].CGColor];//阴影的不透明属性0.0-1.0,默认值为0(完全透明,没有阴影效果)[alertSquare.layer setShadowOpacity:0.4];//设置阴影半径[alertSquare.layer setShadowRadius:20.0f];//设置阴影偏移量[alertSquare.layer setShadowOffset:CGSizeMake(0.0, 0.0)];