Guest User

Untitled

a guest
Aug 21st, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. UITabBar orientation trigger not working in viewcontroller.
  2. // I create the view controller attached to the fourth item in the TabBar
  3. contact *fourthViewController= [[contact alloc] init];
  4. localNavigationController = [[UINavigationController alloc] initWithRootViewController:fourthViewController];
  5. [localNavigationController.tabBarItem initWithTabBarSystemItem:UITabBarSystemItemContacts tag:4];
  6.  
  7. [localControllersArray addObject:localNavigationController];
  8. [localNavigationController release];
  9. [fourthViewController release];
  10.  
  11. [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];UIInterfaceOrientation orientation = [UIDevice currentDevice].orientation;
  12.  
  13. if (orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight)
  14. {
  15. NSLog(@"Landscape");
  16.  
  17. }
  18. else
  19. {
  20. NSLog(@"Portrait");
  21.  
  22. }
Add Comment
Please, Sign In to add comment