I have a NSImageView and want to add a shadow. I’ve tried doing it programmatically with:
NSShadow *shadow = [[[NSShadow alloc] init] autorelease];
[shadow setShadowBlurRadius:4.0f];
[shadow setShadowOffset:CGSizeMake(4.0f, 4.0f)];
[shadow setShadowColor:[NSColor blackColor]];
[view setShadow:shadow];
But it won’t appear. Any ideas? Thanks.
You have to set the parameters of the shadow. By default, it’s all zeroes, so it has no visible effect on a view.
See
-setShadowColor:,-setShadowRadius:, and-setShadowOffset:onNSShadow, I believe.