title: Weird behavior with UISegmentedControl and UIAppearance
body: <p>I am setting the appearance of the segmented control via these statements in the app delegate. </p>
  
  <pre><code>    [[UISegmentedControl appearance] setBackgroundImage:[[UIImage imageNamed:@"segmentation_normal.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0 , 0, 0)] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
      [[UISegmentedControl appearance] setBackgroundImage:[[UIImage imageNamed:@"segmentation_selected.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0 , 0, 0)] 
          forState:UIControlStateSelected barMetrics:UIBarMetricsDefault];
  
      [[UISegmentedControl appearance] setDividerImage:[UIImage imageNamed:@"segmentation_divider_NormalNormal.png"]   forLeftSegmentState:UIControlStateNormal rightSegmentState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
      [[UISegmentedControl appearance] setDividerImage:[UIImage imageNamed:@"segmentation_divider_NormalSelected.png"] forLeftSegmentState:UIControlStateNormal rightSegmentState:UIControlStateSelected barMetrics:UIBarMetricsDefault];
      [[UISegmentedControl appearance] setDividerImage:[UIImage imageNamed:@"segmentation_divider_SelectedNormal.png"] forLeftSegmentState:UIControlStateSelected rightSegmentState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
  </code></pre>
  
  <p>The result is fine. Backgrounds and dividers are set correctly when I select any of the segments (the Order segment is selected by Default when the app first launches). When I select the Release segment as you can see below everything looks fine.</p>
  
  <p><img src="https://i.stack.imgur.com/c6FG6.png" alt="enter image description here"></p>
  
  <p>The problem is when I go out of the view then back to the view (I store the selected index and set it in the viewDidLoad to reselect the segment), the divider is set incorrectly for some unknown reason.</p>
  
  <p><img src="https://i.stack.imgur.com/avgMA.png" alt="enter image description here"></p>
  
  <p>If I tap on A-Z then Release, it corrects itself. This bug only occurs when the view first loads and the selected segment was either Release or A-Z. The divider always looks fine when Order is selected and the view loads.</p>
  
  <p>Image sizes: the divider is 2px wide (all 3 images are the same size), the backgrounds are 2 px wide each.</p>
  
  <p>Any ideas or pointers would be highly appreciated, I have been pulling my hair for the past 10 hours trying to find a solution to no available.</p>