Create rounded UIViews with shadow

[roundedView setBackgroundColor:[UIColor blackColor]];
 
	[[roundedView layer] setCornerRadius:8];
	[[roundedView layer] setMasksToBounds:NO]; 
	[[roundedView layer] setShadowColor:[UIColor blackColor].CGColor];
	[[roundedView layer] setShadowOpacity:1.0f];
	[[roundedView layer] setShadowRadius:6.0f];
	[[self layer] setShadowOffset:CGSizeMake(0, 3)];
 

关键是要把 maskstobounds设置为NO

你可能感兴趣的:(create)