views:

177

answers:

1

Hi Guys,

Here is my problem: - I have one navcontroller and inside it one tabbar controller with 4 view controller. - I want to add following functionality: - On landscapeRight to dismiss navcontroller, tabbar controller and everything and load whole new controller - this one goes ok, here is the code:

- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    MyAppDelegate *appDelegate = (MyAppDelegate *)[[UIApplication sharedApplication] delegate];
    // Just delete the lines for the orientations you don't want to support
    if(toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
            [appDelegate ToHorizontalAverageResponseView:self];
    }
    return YES;
}

Here is the code in the App Delegate:

- (void)ToHorizontalAverageResponseView:(id)sender
{
    HorizontalResponseViewController *tempController = [[HorizontalResponseViewController alloc] initWithNibName:nil bundle:nil];
    [self setHorizontalResponseViewController: tempController];
    [tempController release];
    //[UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationLandscapeRight;
    // View rotation transformation
    CGAffineTransform landscapeTransform = CGAffineTransformMakeRotation( M_PI * 90.0 / 180.0 );
    [[horizontalResponseViewController view] setTransform:landscapeTransform];

    [window addSubview:[horizontalResponseViewController view]];
}

The question is how to transfer back to portrait view and all those navbar and tabbar controllers?

Thx, Mladen

A: 

It sounds like you are trying to build something along the lines of the iPod-CoverFlow transition. The question (on how to build the coverflow effect) was asked in Stanford's CS193P lecture and the answer hinted in the following direction:

If you can afford the memory overhead, it may be the best thing to add a new landscape view on top of all the portait views (not discarding them as you suggest). The user then interacts with this landscape view as desired until going back to portrait. All this time, the portrait views remained quietly in the background.

Hauke
I can't remember exactly which one of the lectures it was, but it was one of the first six. They can be found on iTunes U as videos.
Hauke