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!

有帮助吗?

解决方案

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!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top