【发布时间】:2012-10-22 19:42:11
【问题描述】:
我正在通过关注为我的视图添加阴影
- (void)viewDidLoad{
[super viewDidLoad];
self.view.layer.shadowColor = [UIColor blackColor].CGColor;
self.view.layer.shadowOffset = CGSizeMake(0.0f, 0.0f);
self.view.layer.shadowOpacity = 1.0f;
self.view.layer.shadowRadius = 4.0f;
self.view.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.view.bounds].CGPath;
}
但是,我得到一个完全没有阴影的视图,如下所示
我是不是在中途遗漏了一些要点。请就这个问题给我建议
【问题讨论】:
-
我确实在
Link Binary With Libraries中添加了夸脱,我还在我的班级中添加了#import <QuartzCore/QuartzCore.h>..
标签: objective-c ios calayer shadow