Chris Pillen
Chris Pillen

Reputation: 818

View of ViewController over ViewController: I want a drop shadow on the left?

I use this code to add a drop shadow to a view that is above another view.

CGRect rect = CGRectMake(90, 0, 230, 460);

FeedsViewController *feedsViewController = [[FeedsViewController alloc] init];
[feedsViewController.view setFrame:rect];
self.feedsViewController = feedsViewController;
[feedsViewController release];

[[feedsViewController.view layer] setShadowOffset:CGSizeMake(0, 1)];
[[feedsViewController.view layer] setShadowColor:[[UIColor darkGrayColor] CGColor]];
[[feedsViewController.view layer] setShadowRadius:3.0];
[[feedsViewController.view layer] setShadowOpacity:0.8];
[self.view.superview addSubview:feedsViewController.view];

But it does not work, why?

Upvotes: 0

Views: 1535

Answers (1)

Chris Pillen
Chris Pillen

Reputation: 818

I simply forgot

#import <QuartzCore/QuartzCore.h>

Sorry for that.

Upvotes: 1

Related Questions