title: How make a transparent & flat UIBarButtonItem?
body: <p>I wanna to make buttons for my app flat &amp; transaparent, like the ones in the kindle app (<a href="http://treypennington.com/wp-content/uploads/2010/09/kindlescreenshot.jpg" rel="nofollow">see the shop button</a>).</p>
  
  <p>I try to set a custom background by code with not luck (the button is draw as a rectangle, with he border color fill all the background):</p>
  
  <pre><code>- (UIImage *) screenshot {
      // Create a graphics context with the target size
      // On iOS 4 and later, use UIGraphicsBeginImageContextWithOptions to take the scale into consideration
      // On iOS prior to 4, fall back to use UIGraphicsBeginImageContext
      CGSize imageSize = self.bounds.size;
  
      if (NULL != UIGraphicsBeginImageContextWithOptions)
          UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0);
      else
          UIGraphicsBeginImageContext(imageSize);
  
      CGContextRef context = UIGraphicsGetCurrentContext();
  
      [self.layer renderInContext:context];
  
      UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
      UIGraphicsEndImageContext();
  
      return image;   
  }
  
  +(UIImage *) buttonFlat {
      UIView *bt = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 1.0f, 1.0f)];
  
      bt.backgroundColor = [UIColor blackColor];
      bt.layer.borderColor = [UIColor lightGrayColor].CGColor;
      bt.layer.borderWidth = 1;
      bt.layer.cornerRadius = 5.0;
      bt.alpha = 0.7;
  
      return [bt screenshot];
  }
  </code></pre>
  
  <p>I know how do this with a normal UIButton, but prefer to make this so I can retain the standard icons of the UIBarButtonItem if possible...</p>