title: UIActivityViewController's SMS window becomes partially transparent
body: <p>I'm seeing a very strange UI effect when calling UIActivityViewController and the user subsequently selects the Messages option.</p>
  
  <p>I've reduced the code in question down to the bare details:</p>
  
  <pre><code>NSArray *activityItems = @[@"Hello!"];
  UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
  [self presentViewController:activityController animated:YES completion:nil];
  </code></pre>
  
  <p>When the user selects the Messages app, the subview containing the "To:" field has a gradient background:</p>
  
  <p><img src="https://i.stack.imgur.com/2ndEQ.png" alt="Initial view"></p>
  
  <p>The user then begins to type (nothing surprising here):</p>
  
  <p><img src="https://i.stack.imgur.com/WGJJg.png" alt="User typing"></p>
  
  <p>And then the user deletes what they've just typed - causing the "To:" view to go transparent.  What shows through is UI from my app.</p>
  
  <p><img src="https://i.stack.imgur.com/3B7lP.png" alt="After user deletes what they&#39;ve typed"></p>
  
  <p>There's no way to get the "To:" view back, although typing does work (nothing displays).</p>
  
  <p>The code above works fine in a dummy app.  I'm sure something in this app is causing the issue, but I've been unable to find the cause (or even understand what could cause this).  This is in a UITableViewController but I've put the same code into a plain UIViewController with the same results.  I've wrapped in a dispatch_async(dispatch_get_main_queue()...) call, set the statusBar to be visible, etc.  No change.  Any suggestions appreciated!</p>
  
  <p><strong>Solution</strong></p>
  
  <p>The culprit was a wacky UIAppearance selector on UINavigationBar:</p>
  
  <pre><code>[[UINavigationBar appearance] setBackgroundImage:[self whitePixelImage] forBarMetrics:UIBarMetricsDefault];
  </code></pre>
  
  <p>where "whitePixelImage" was exactly what you might expect:</p>
  
  <pre><code>-(UIImage *)whitePixelImage {
      return [self imageWithColor:[UIColor whiteColor]];
  }
  
  -(UIImage *)imageWithColor:(UIColor *)color {
      CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
      UIGraphicsBeginImageContext(rect.size);
      CGContextRef context = UIGraphicsGetCurrentContext();
  
      CGContextSetFillColorWithColor(context, [color CGColor]);
      CGContextFillRect(context, rect);
  
      UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
      UIGraphicsEndImageContext();
  
      return image;
  }
  </code></pre>
  
  <p>My suspicion is the one pixel size was the issue, but due to design changes to the app no longer requiring this selector I was quite happy to remove the whole darned thing.</p>