NavigationBar height Changes to original height (44.0) as orientation changes!!!

Discussion in 'iOS Programming' started by AbhishekApple, Dec 20, 2010.

  1. macrumors member

    Joined:
    Aug 5, 2010
    #1
    I have set the navigation bar height to 100 but when i switch the orientation the height of the navigation bar resumes to 44.0???????????
    Please suggest
    (I need to set an image of height 100 on it...)
    Code:
    // Ensure that the view controller supports rotation and that the split view can therefore show in both portrait and landscape.
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    	if (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
    		CGRect navframe = [[self.navigationController navigationBar] frame];
    		NSLog(@"Navframe=%f",navframe.size.height);//44.000;
    		
    		[[self.navigationController navigationBar] setFrame:CGRectMake(navframe.origin.x, navframe.origin.y, navframe.size.width, 100)];	
    		NSLog(@"Navframechanged=%f",navframe.size.height);
    	}
    	else {
    		CGRect navframe = [[self.navigationController navigationBar] frame];
    		NSLog(@"Navframe=%f",navframe.size.height);//44.000;
    		
    		[[self.navigationController navigationBar] setFrame:CGRectMake(navframe.origin.x, navframe.origin.y, navframe.size.width, 100)];	
    		NSLog(@"Navframechanged=%f",navframe.size.height);
    		NSLog(@"Landscape");
    	}
    	
    	
    
    	return YES;
    }
    
     

Share This Page