码迷,mamicode.com
首页 > 移动开发 > 详细

IOS view的圆角和阴影并存

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

标签:http   color   os   io   ar   size   .net   ad   

 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   color   os   io   ar   size   .net   ad   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!