title: Moving objects around when the view rotates
body: <p>I have an iPad app that I would like to work in the sideways orientation instead of just portrait. I have programatically placed images, labels, and buttons into my view and used CGRectMake (x,x,x,x) to tell them where to go on the view into the center. When the app rotates horizontally, I need my labels and buttons to shift up (since they can't go down as far when in landscape mode), but stay in the center. Here is some code I've been playing with:</p>
  
  <pre><code>if((self.interfaceOrientation == UIDeviceOrientationLandscapeLeft) || (self.interfaceOrientation == UIDeviceOrientationLandscapeRight)) 
  {
      lblDate = [[UILabel  alloc] initWithFrame:CGRectMake(384-(fieldWidth/2)-30,controlTop+45,120,40)]; //these dimensions aren't correct, though they don't matter here
  
      lblDate.text = @"Date:";
      lblDate.backgroundColor = [UIColor clearColor];
      [contentView addSubview:lblDate];
  } else {
      //the orientation must be portrait or portrait upside down, so put duplicate the above code and change the pixel dimensions
  }
  </code></pre>
  
  <p>Thanks for your help!</p>