ITeye博客

Create rounded UIViews with shadow

zani · 2011-10-22 21:46 · UIView · 移动开发 · Markdown

[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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。