IOS UIView 圆角和阴影并存

2018 年 1 月 8 日 0 条评论 3.57k 次阅读 0 人点赞
UIView *view = [[UIView alloc]initWithFrame:CGRectMake(10, 10, 100, 100)];
view.backgroundColor=[UIColor yellowColor];
//view.layer.masksToBounds=YES;这行去掉
view.layer.cornerRadius=10;
view.layer.shadowColor=[UIColor redColor].CGColor;
view.layer.shadowOffset=CGSizeMake(10, 10);
view.layer.shadowOpacity=0.5;
view.layer.shadowRadius=5;
[self.view addSubview:view];



/* When true an implicit mask matching the layer bounds is applied to
 * the layer (including the effects of the `cornerRadius' property). If
 * both `mask' and `masksToBounds' are non-nil the two masks are
 * multiplied to get the actual mask values. Defaults to NO.
 * Animatable. */

IOS view的圆角和阴影并存

雷雷

这个人太懒什么东西都没留下

文章评论(0)

(Spamcheck Enabled)