title: ios7 UINavigationBar in screenshot becomes black
body: <p>I am porting my project from ios6 to 7. I have a function to make a screenshot of my view which has a navigation bar, on ios6 it works fine, but on ios7 bar in screenshot becomes black.</p>
  <p>As you can see from the image, I have a navigation bar at top, a tool bar in the middle and a tab bar at the bottom,</p>
  <p>Screen shot code:</p>
  <pre><code>UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, YES, [[UIScreen mainScreen] scale]);
  [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
  UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
  </code></pre>
  <p><img src="https://i.stack.imgur.com/8QsPs.png" alt="enter image description here" />
  <img src="https://i.stack.imgur.com/1pxcc.png" alt="enter image description here" /></p>