title: How to make segmented control like this
body: <p>Today I'm creating a custom segmented control. The appearance of the control as follow:
  <p>
  <img src="https://i.stack.imgur.com/12kHI.png" alt="enter image description here"></p>
  
  <p>I tried two methods:</p>
  
  <pre><code>- (void)setBackgroundImage:(UIImage *)backgroundImage 
                    forState:(UIControlState)state 
                  barMetrics:(UIBarMetrics)barMetrics
  
  - (void)setDividerImage:(UIImage *)dividerImage 
      forLeftSegmentState:(UIControlState)leftState 
        rightSegmentState:(UIControlState)rightState 
               barMetrics:(UIBarMetrics)barMetrics
  </code></pre>
  
  <p>However, here is the result I got:<br>
  <img src="https://i.stack.imgur.com/q4iDJ.png" alt="enter image description here"></p>
  
  <p>I extracted the border image and the divider line (vertical line) from the design, but the result looks bad. Please help me if you have any idea.</p>