控件阴影制作


p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #ffffff}p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #00afca}p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #ffffff; min-height: 14.0px}span.s1 {font-variant-ligatures: no-common-ligatures}span.s2 {font-variant-ligatures: no-common-ligatures; color: #c2349b}span.s3 {font-variant-ligatures: no-common-ligatures; color: #ffffff}span.s4 {font-variant-ligatures: no-common-ligatures; color: #00afca}span.s5 {font-variant-ligatures: no-common-ligatures; color: #8b84cf}

- (void)viewDidLoad {
    [super viewDidLoad];

    UIView *view = [[UIView alloc] init];
    view.frame = CGRectMake(50, 50, 200, 200);
    view.backgroundColor = [UIColor yellowColor];
    view.layer.shadowColor = [UIColor grayColor].CGColor;//设置阴影颜色
    view.layer.shadowOffset = CGSizeMake(10, 10);//设置阴影偏移量
    view.layer.shadowPath = [UIBezierPath bezierPathWithRect:view.layer.bounds].CGPath;//设置阴影区域(大小)
    view.layer.shadowOpacity = 1.6f;//设置阴影不透明度
    view.layer.shadowRadius = 5.0;//设置阴影边缘范围

    [self.view addSubview:view];
}
控件阴影制作_第1张图片
Simulator Screen Shot 2016年2月5日 下午12.43.30.png

你可能感兴趣的:(控件阴影制作)