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. */
© 著作权归作者所有
文章评论(0)