tags:

views:

185

answers:

0

I am trying to resize my toolbar which sits on main window, so that it is available to all the views in NavigationController (root controller). Here is what being done in root controller (Sub class of UINavigationController):

- (void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation 
                                 duration:(NSTimeInterval)duration
{
    BOOL bLandscape = FALSE;
    [UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationLandscapeLeft;
    MyAppDelegate* delegate =  [[UIApplication sharedApplication] delegate];
    UIToolbar* pToolBar = delegate.pToolBar;
    pToolBar.transform = CGAffineTransformIdentity;
    if(toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft 
       || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) 
    {
        bLandscape = TRUE;
        if(toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft)
        {
            NSLog(@"UIInterfaceOrientationLandscapeLeft");
            pToolBar.transform = CGAffineTransformMakeRotation(degreesToRadian(-90));
            pToolBar.center = CGPointMake(768 - 20, 1024 / 2);
            //pToolBar.bounds = CGRectMake(768, 1000 - 20, 1024, 44); // Here is problem
        }
        else
        { 
        }
    }
    else
    {
    }
    if(bLandscape)
    {
        // Custom controller rotation
    }
}

Changing the toolbar's center moves it to the bottom of the screen with all buttons on it (Everything is OK) and when I try to resize it by changing its bounds, bar buttons are not seen.

Any help would be really appreciated.