iOS view圆角加阴影
2018-11-29 本文已影响14人
名a字太难搞了
UIView *view=[[UIView alloc]initWithFrame:CGRectMake(100, 100, 100, 100)];
view.backgroundColor=[UIColor yellowColor];
//v.layer.masksToBounds=YES;这行去掉
view.layer.cornerRadius=10;
view.layer.shadowColor=[UIColor redColor].CGColor;
view.layer.shadowOffset=CGSizeMake(0, 0);
view.layer.shadowOpacity=0.5;
view.layer.shadowRadius=5;
[self.view addSubview:view];