Question

For rotating views for LandScape to portrait and their corresponding controls like buttons and labels etc.. Actually the willRotateToInterfaceOrientation method is not calling in iOS7. I'm using like this for view rotating,

-(BOOL)shouldAutorotate
{
    return [[self.viewControllers lastObject] shouldAutorotate];
}

I need to set the frames here. How can I achieve this? Please do help. Thanks!

Was it helpful?

Solution

To set frames for your view, you should access the frame property of your view and replace it with a new frame. For example:

CGRect newFrame = CGRectMake(newX, newY, newWidth, newHeight);
yourView.frame = newFrame;

Where newX, newY, newWidth and newHeight are of type CGFloat.
You may do the same for the controls. For example:

yourLabel.frame = newFrame;

Hope this helps!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top