Problem with orientation
Hi everybody,
I am new to sdk/objective-C and I'm having some trouble with an app.
When I have landscape-view-orientation my image doesn't fit to screen.
The image rotates and its ok but the screen size is remaining inside the initial scrollFrame size (320,460).
I am sure that is something very easy but I don't have the knowledge to find it
My code is:
.m file
#import "UITestViewController.h"
UIImageView *largeImageView;
UIImageView *smallImageView;
@implementation UITestViewController
- (void)noteOrientationChanged

NSNotification *)aNotification {
[self setBackgroundForOrientation:[UIDevice currentDevice].orientation];
}
- (void)viewDidLoad {
[super viewDidLoad];
//---------
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(noteOrientationChanged
name:UIDeviceOrientationDidChangeNotification
object:nil];
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
//---------
CGRect scrollFrame = CGRectMake(0,0,320,460);
UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:scrollFrame];
scrollView.minimumZoomScale = 0.3;
scrollView.maximumZoomScale = 1.0;
scrollView.delegate = self;
UIImage *bigImage = [UIImage imageNamed:@"imageTest.jpg"];
largeImageView = [[UIImageView alloc] initWithImage:bigImage];
//-------------
UIImageView * smallImageView = [[UIImageView alloc] initWithFrame:CGRectMake(1510, 896, 52, 43)];
[smallImageView setImage:[UIImage imageNamed:@"demo.png"]];
//-------------------------------------------------------
[scrollView addSubview:largeImageView];
[largeImageView addSubview:smallImageView];
scrollView.contentSize = largeImageView.frame.size;
[self.view addSubview:scrollView];
scrollView.showsVerticalScrollIndicator = NO;
scrollView.showsHorizontalScrollIndicator = NO;
[scrollView release];
}
scrollView.autoresizingMask = (UIViewAutoresizingFlexibleRightMargin
|
UIViewAutoresizingFlexibleLeftMargin
|
UIViewAutoresizingFlexibleTopMargin
|
UIViewAutoresizingFlexibleBottomMargin);
- (UIView *)viewForZoomingInScrollView

UIScrollView *)scrollView
{
return largeImageView;
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)dealloc {
[largeImageView release];
[super dealloc];
}
@end
Does anyone have any ideas?
Thank you for your time!
Maria