1


I have problem when using modalPresentationStyle.
I call the following function in my tabbarcontroller's first view controller's viewDidload
So that the login viewController is displayed when app launches

But the problem is when I launch app in Landscape mode I can see the login view correctly and I rotate the iPad to portrait mode the background of login viewcontroller that is my First tabbar viewcontroller goes up by about 20pixels

I create a new app to check and I found this will only happend when we use tabbar.
and when App launches in portrait mode its works great!

-(void)gotoCredentials {
Login *objLoginViewController=[[Login alloc] initWithNibName:@"Login" bundle:nil];        
 UINavigationController *objnavigationController = [[UINavigationController alloc] 
                initWithRootViewController:objLoginViewController];       
 objnavigationController.modalPresentationStyle=UIModalPresentationFormSheet;
 objLoginViewController.modalPresentationStyle=UIModalPresentationFormSheet;
 [self  presentModalViewController:objnavigationController animated:YES];
 //[self.tabBarController presentModalViewController:objnavigationController animated:YES];
 [objLoginViewController release];
 objLoginViewController=nil;
 [objnavigationController release];
 objnavigationController=nil;
}

thanks in advance!

Naveen Shan
  • 9,192
  • 3
  • 29
  • 43

1 Answers1

0

sorry it is fixed by setting tabbar controller selection

[m_objTabBarController setSelectedIndex:0];

after creating tabbar. I dont know that happens here.
But I think to do so is because after dissmiss FormSheet and change the tab then looks fine so I try setting tabbar selected index and it work great...

Naveen Shan
  • 9,192
  • 3
  • 29
  • 43