0

while in the simulator the problem don't subsist, i've a problem with a view after auto rotating to landscape orientation. When I load the app in portrait, all works fine, but when i rotate the device (iPod touch 1st gen. 3.1.3) to landscape the result is this: http://imageshack.us/photo/my-images/155/img0021n.png/ . If i switch to the second view ("Riepilogo" i.e. a table view) and then back to the first, the view fit perfectly in landscape, but if I rotate again to the portrait orientation, the problem is the same as above.

Here is the code of shouldAutorotateToInterfaceOrientation:

- (BOOL)shouldAutorotateToInterfaceOrientation(UIInterfaceOrientation)interfaceOrientation{
if (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight) {

    [self.scrollView setContentSize: CGSizeMake(480,416)]; 

} else {

    [self.scrollView setContentSize: CGSizeMake(320, 416)];

}

return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight); }

P.S. The view is an instance of UIScrollView

1 Answer 1

0

Resizing a scrollview doesn't resize its contents.

1
  • A scrollview has subviews. Resize the ones you want to resize. Oct 22, 2011 at 10:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.