質問

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