title: iOS6 Add Shadow to A Container UIView With A Corner Radius
body: <p><em>How can an encompassing UIView have both a shadow and a corner radius at the same time?</em></p>
  
  <p>I have tried other solutions suggested on SO multiple times, but unfortunately they do not seem to work for iOS6 (or at least not for me)</p>
  
  <p>So I thought I might post this, so that an iOS6 solution can be found.</p>
  
  <p>I have a container <code>UIView</code> which contains two subviews</p>
  
  <pre><code>- a custom UIImageView
  - a custom UIView
  </code></pre>
  
  <p>I would like the entire UIView to have a corner radius of 2.5, but I would also like the UIView to have a shadow. <strong>However, so far, I get only 1 of these 2 desires, never both at the same time.</strong></p>
  
  <p>Here is my code, I have different versions of it with my different attempts with SO solutions, but this is just one of my versions.</p>
  
  <pre><code>    self.layer.shouldRasterize = YES;
      self.layer.rasterizationScale = [UIScreen mainScreen].scale;
      self.layer.cornerRadius = 2.5;
      self.layer.masksToBounds = YES;
      self.layer.shadowColor = [UIColor colorWithWhite:0.0 alpha:0.1].CGColor; //0.1
      self.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.bounds].CGPath;
      self.layer.shadowOpacity = 1.0;
      self.layer.shadowRadius = 3.0;
  </code></pre>
  
  <p>^here <strong>self</strong> is the containing custom UIView with two subviews described above</p>
  
  <p>Does anyone know of an iOS6 solution to this problem?</p>
  
  <hr>
  
  <p>UPDATE</p>
  
  <p>So, I do not need a border colour, so I was not adding that when I saw the solutions, but this time I added that, using the solution in the comment below, and it seems that the UIView is getting rounded, but I really want the combined UIImageView and UIView to get rounded.</p>
  
  <p>So basically, the UIImageView is on top, and the UIView is on the bottom.</p>
  
  <p>So how do I get only the top of the UIImageView to be rounded, and only the bottom of the UIView to be rounded.</p>
  
  <p>Thanks.</p>
  
  <p><strong>Note: shadows work as one whole object, but the corner radius is not working as one whole object?</strong></p>