I have one UIImageView with a UIButton partially overlapping it. I want the user to see the image and the button as one joined object. When I try to give them drop shadow using QuartzCore:
image.layer.shadowOffset = CGSizeMake(5,5);
button.layer.shadowOffset = CGSizeMake(5,5);
The Button’s shadow will partly drop on the image. I want the button shadow to only drop for the part that are outside the image. Something like the union of two rectangles. Help will be appreciated!
Thanks
Leo
Put the
UIImageViewand theUIButtoninto a parent view. Set the shadow on the parent view. Make sure the parent view is not opaque and has a transparent background color: