Dear fellow Macrumors members,
I'm creating an iPad app with a UIScrollview. Within this scrollview there are several images and textfields.
When I'm rotating the iPad (to landscape) i'd like to put the images in vertical order and in Portrait in horizontal order.
I already succeeded with making the scrollview within these two views. Is there anyone who can give me some advice about this issue?
Here is a part of my code that I programmed within the shouldautorotate method.
Hope someone got some good tips.
I'm creating an iPad app with a UIScrollview. Within this scrollview there are several images and textfields.
When I'm rotating the iPad (to landscape) i'd like to put the images in vertical order and in Portrait in horizontal order.
I already succeeded with making the scrollview within these two views. Is there anyone who can give me some advice about this issue?
Here is a part of my code that I programmed within the shouldautorotate method.
Code:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if(interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
interfaceOrientation == UIInterfaceOrientationLandscapeRight){
interfaceOrientation == UIInterfaceOrientationLandscapeLeft;
backgroundImage.image = [UIImage imageNamed:@"Achtergrond_Liggend_Opstelling.png"];
scroller.frame = CGRectMake(0, 104, 130, 660);
scroller.contentSize = CGSizeMake(130, 1200);
}
if(interfaceOrientation == UIInterfaceOrientationPortrait ||
interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown){
interfaceOrientation == UIInterfaceOrientationPortrait;
backgroundImage.image = [UIImage imageNamed:@"Achtergrond_Staand_Opstelling.png"];
scroller.frame = CGRectMake(0, 890, 768, 112);
scroller.contentSize = CGSizeMake(1200, 112);
scroller.showsHorizontalScrollIndicator = FALSE;
}
[super viewDidLoad];
}
Last edited by a moderator: