views:

520

answers:

1

I am trying to develop an application which is geo-sensetive. So, I have written -

(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    // return (interfaceOrientation == UIInterfaceOrientationPortrait);
    return YES;
}

I have put different images on that screen and I have to resize it when the view is changing, So,what ca I do?

A: 

-shouldAutorotateToInterfaceOrientation: is a method on UIViewController which will cause its view to be resized when the orientation of the device changes.

You have two main approaches to resizing the subviews of that view:

1) You can set the autoresizingMask of that view's subviews so that they change size when their superview changes size. If you're adding the subviews using Interface Builder, you can set these masks visually from the Size panel.

2) You can override -layoutSubviews in that view and resize them manually in that method.

hatfinch