title: hiding and adjusting of textfields based on view iOS
body: <p>I am naive in iOS. I am developing a registration page which consists of hiding textfields based on views. In order to achieve this i implemented UISegmentedControl for views and used the following code for hiding the textfield based on segments</p>
  
  <pre><code>- (IBAction)regSegmentButton:(id)sender {
  
  if (_registrationSegment.selectedSegmentIndex ==1) {
      self.vendorID.hidden = NO;
  }
  else {
      self.vendorID.hidden = YES;
  }
  
  }
  </code></pre>
  
  <p>Even though i achieved what i intended but the view is absurd. The view is represented below in images
  <a href="https://i.stack.imgur.com/iKelA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iKelA.png" alt="customerscreen"></a>
  <a href="https://i.stack.imgur.com/uspmf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uspmf.png" alt="vendorscreen"></a></p>
  
  <p>My question is how to make the view look normal even after hiding the field same as the way it is represented in "vendorscreen.png"(second image). Do i need to apply any animation in order to achieve it? if yes please let me know how to do it </p>
  
  <p>Please do the needful..</p>