标签:
这是一种利用贝塞尔曲线显示阴影增加模块立体感的方法
具体代码如下
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(100, 200, 200, 200)];
[imageView setImage:[UIImage imageNamed:@"001"]];
UIBezierPath *shadowPath = [UIBezierPath bezierPathWithRect:imageView.bounds];
imageView.layer.masksToBounds = NO;
imageView.layer.shadowColor = [UIColor blackColor].CGColor;
imageView.layer.shadowOffset = CGSizeMake(0.0f, 5.0f);
imageView.layer.shadowOpacity = 0.5f;
imageView.layer.shadowPath = shadowPath.CGPath;
[self.view addSubview:imageView];
标签:
原文地址:http://www.cnblogs.com/var-king/p/5787303.html