title: Key board hides textField when Orientation Changes?
body: <p>I have two textfields in a subview as viewLogin. when try to enter text key board is hiding them. I solved that problem by moving the viewLogin.
  Code is...</p>
  
  <pre><code>- (void)textFieldDidBeginEditing:(UITextField *)textField {
  
      UIDeviceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
  
      if (orientation == UIDeviceOrientationLandscapeLeft || orientation == UIDeviceOrientationLandscapeRight) {
  
          viewLogin.frame = CGRectMake((1024-viewLogin.frame.size.width)/2, (768-viewLogin.frame.size.height)/9, viewLogin.frame.size.width, viewLogin.frame.size.height);
      }
      else {
          viewLogin.frame = CGRectMake((768-viewLogin.frame.size.width)/2, (1024-viewLogin.frame.size.height)/2, viewLogin.frame.size.width, viewLogin.frame.size.height);
      }
  }
  
  - (void)textFieldDidEndEditing:(UITextField *)textField {
  
      UIDeviceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
  
      if (orientation == UIDeviceOrientationLandscapeLeft || orientation == UIDeviceOrientationLandscapeRight) {
          viewLogin.frame = CGRectMake((1024-viewLogin.frame.size.width)/2, (768-viewLogin.frame.size.height)/2.5, viewLogin.frame.size.width, viewLogin.frame.size.height);
      }
      else {
          viewLogin.frame = CGRectMake((768-viewLogin.frame.size.width)/2, (1024-viewLogin.frame.size.height)/2, viewLogin.frame.size.width, viewLogin.frame.size.height);
      }
  }
  </code></pre>
  
  <p>Problem here i facing is if i first change the orientation to Landscape and click on textField its working fine but if i first click on textField in portrait mode and then changed to Landscape left/right its not working..</p>
  
  <p>can some help me to solve this....</p>
  
  <p>Thanks in advance   </p>