Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. [self.tabBarController.tabBar setHidden:YES];
  2.  
  3. [self.window addSubview:self.tabBarController.view];
  4.  
  5. - (void)hideTabBar:(UITabBarController *) tabbarcontroller
  6. {
  7. [UIView beginAnimations:nil context:NULL];
  8. [UIView setAnimationDuration:0.5];
  9.  
  10. for(UIView *view in tabbarcontroller.view.subviews)
  11. {
  12. if([view isKindOfClass:[UITabBar class]])
  13. {
  14. [view setFrame:CGRectMake(view.frame.origin.x, 480, view.frame.size.width, view.frame.size.height)];
  15. }
  16. else
  17. {
  18. [view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 480)];
  19. }
  20. }
  21.  
  22. [UIView commitAnimations];
  23. }
  24.  
  25. - (void)viewDidLoad {
  26. [super viewDidLoad];
  27.  
  28. self.hidesBottomBarWhenPushed = YES;
  29. }
  30.  
  31. - (void)hideTabBar{
  32.  
  33.  
  34. for (UIView *view in self.tabBarController.view.subviews) {
  35.  
  36. if ([view isKindOfClass:[UITabBar class]]) {
  37.  
  38. view.frame = CGRectMake(view.frame.origin.x,
  39. [UIScreen mainScreen].bounds.size.height,
  40. view.frame.size.width,
  41. view.frame.size.height);
  42. } else {
  43.  
  44. view.frame = CGRectMake(view.frame.origin.x,
  45. view.frame.origin.y,
  46. view.frame.size.width,
  47. [UIScreen mainScreen].bounds.size.height);
  48. }
  49. }
  50. }
  51.  
  52. - (void) showTabBar {
  53.  
  54.  
  55. for (UIView *view in self.tabBarController.view.subviews) {
  56.  
  57.  
  58. if ([view isKindOfClass:[UITabBar class]]) {
  59.  
  60. view.frame = CGRectMake(view.frame.origin.x,
  61. [UIScreen mainScreen].bounds.size.height - 49,
  62. view.frame.size.width,
  63. view.frame.size.height);
  64.  
  65. } else {
  66.  
  67. view.frame = CGRectMake(view.frame.origin.x,
  68. view.frame.origin.y,
  69. view.frame.size.width,
  70. [UIScreen mainScreen].bounds.size.height - 49);
  71. }
  72. }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement