I have a UILabel that I need to shift up by about 50 pixels on application start (because it starts out in portrait, and I designed it in landscape) and then once again whenever it is put back in portrait. Right now I'm using a CGRect
based on its current frame. The problem is when I try to rotate the phone the frame uses the portrait values and it places the label way off. I've tried using a couple other methods, all based around CGRect, and while they kept the label on the right axis, it was shifted all over the place. At the same time I'm doing this, I'm also changing the size of the font, so I think that this might affect something.
The code I used is:
//In ViewDidLoad
CGRect defBox = self.seperator.frame;
//On Rotation to Portriate
CGRect newBox = self.seperator.frame;
newBox.origin.y += 50;
self.seperator.frame = newBox;
//On Rotation to Landscape
self.seperator.frame = defBox;