首页 > 移动平台 > 详细

IOS view的圆角和阴影并存

时间:2014-08-14 16:09:29      阅读:364      评论:0      收藏:0      [点我收藏+]

 UIView *v=[[UIView alloc]initWithFrame:CGRectMake(10, 10, 100, 100)];
    v.backgroundColor=[UIColor yellowColor];
    //v.layer.masksToBounds=YES;这行去掉
    v.layer.cornerRadius=10;
    v.layer.shadowColor=[UIColor redColor].CGColor;
    v.layer.shadowOffset=CGSizeMake(10, 10);
    v.layer.shadowOpacity=0.5;
    v.layer.shadowRadius=5;

    [self.view addSubview:v];

 

效果如下

 

bubuko.com,布布扣

 

/* 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的圆角和阴影并存,布布扣,bubuko.com

IOS view的圆角和阴影并存

原文:http://www.cnblogs.com/yunis/p/3912461.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!