Well in this case below is what I would have done.
My assumption is all three views are of size 320 x 480 (considering iPhone 4)
let's say you have three views as below.
- View 1 >> view001
- View 1 >> view001
- View 1 >> view001
What I would do is add a scrollview mainScrollView
.
Now let's consider you want to show view001
only.
- (void) showView001Only {
view001.hidden = NO;
view002.hidden = YES;
view003.hidden = YES;
mainScrollView.hidden = YES;
}
Now let's say you want to show two views as view002
and view003
. In this case I would have added both views in scroll view and add one below each other.
- (void) showView0023Only {
view001.hidden = YES;
view002.hidden = NO;
view003.hidden = NO;
mainScrollView.hidden = NO;
[mainScrollView addSubview:view002];
view002.frame = CGRectMake(0,0,320,480);
[mainScrollView addSubview:view003];
view003.frame = CGRectMake(0,480,320,480);
// now set mainscrollview content size to 320x960
[mainScrollView setContentSize: CGSize(320, 960)];
}
I hope this is what you are looking for.
If you want to show both views on same screen without scrolling then I would say its all depend on what you have in view1 and view2.