title: Can't set cornerRadius AND shadow on layer that has an image view stretched to its bounds?
body: <p>This is stumping me. I have a UIView (call it "parent"). The bottommost subview of that view is a UIImageView (call it "child"), whose frame occupies the entirety of the "parent" bounds.</p>
  
  <p>I want to round the corners on the "parent" view, and set a drop shadow. I do this on the <code>CALayer</code> of "parent" as usual:</p>
  
  <pre><code>[[parent layer] setShadowOffset:CGSizeMake(5, 5)];
  [[parent layer] setShadowRadius:6];
  [[parent layer] setShadowOpacity:0.4];    
  [[parent layer] setCornerRadius:6];
  </code></pre>
  
  <p>This shows the shadow correctly, but does not round the corners. </p>
  
  <p>Here's the kicker:</p>
  
  <ol>
  <li>If I remove the "child" image view, or shrink it so it doesn't occupy the whole bounds of the "parent" view, I get the rounded corners and shadow correctly on the parent.</li>
  <li>If I leave the "child" alone but set "clipsToBounds" on the "parent" view, I get the corners correctly. But now the shadow's gone.</li>
  <li>Setting the corner radius on the layer of the <em>child</em> as well seems to have no effect.</li>
  </ol>
  
  <p>It seems like the "child" image view is just obscuring the rounded corners on the "parent" view since it takes up the whole rect, and clipping based on the parent view gets the corners but also masks off the shadow. Not sure why #3 doesn't work.</p>
  
  <p>What am I missing? Have I been overlooking something obvious by staring at this too long?</p>
  
  <p>Thanks.</p>
  
  <p>(Shockingly, the tag "roundedcorners-dropshadow" already exists. Awesome.)</p>