title: UISegmentedControl's alignment get change when hiding UINavigationItem buttons
body: <p>I have an <code>UISegmentedControl</code> in the title view of the navigation bar. Also i have right bar button(<em>plus</em>) and left bar button(<em>Edit</em>) as shown in the below image..</p>
  
  <p><img src="https://i.stack.imgur.com/vAfuW.png" alt="Department button selected"></p>
  
  <p>I'm hiding the two bar buttons (here, edit &amp; plus buttons) when the ID segment is clicked. This will be like..</p>
  
  <p><img src="https://i.stack.imgur.com/4OBOR.png" alt="ID button selected"></p>
  
  <p>I'm using the following code to hide bar button items.</p>
  
  <pre><code>- (void)segmentClicked {
      segment = segmentedControl.selectedSegmentIndex;
      self.navigationItem.leftBarButtonItem = leftBarButton;  //leftBarButton is an instance of UIBarButtonItem
      self.navigationItem.leftBarButtonItem = rightBarButton;  //rightBarButton is an instance of UIBarButtonItem
  
      if (segment == 0) {
          //Do something for segment 1 click
      }
      else if (segment == 1) {
          //Do something for segment 2 click
      }
      else {
          self.navigationItem.leftBarButtonItem = nil;
          self.navigationItem.rightBarButtonItem = nil;
      }
  }
  </code></pre>
  
  <p>My problem is, when i switch from <em>segment1</em>(Department) or <em>segment2</em>(Name) to <em>segment3</em>(ID), the <code>UISegmentedControl</code> alignment get changed. How can i make it stable?</p>
  
  <p>Thanks in Advance</p>