9

I use UINavigationController inside UITabBarController and one of the screens in my navigationcontroller is a UIImageView. When I want to show that image full screen I have to hide the navigation bar and tab bar. I'm able to hide the navigation bar correctly but when I hide the tab bar, it leaves 50px of white space. Any suggestion?

Lorenzo B
  • 33,216
  • 24
  • 116
  • 190
SamehDos
  • 1,183
  • 1
  • 10
  • 23
  • 1
    Self-contained samples are useful to understand what is going on. Try to edit your question. thank you. – Lorenzo B Feb 03 '12 at 11:57
  • Since iOS 8 all the "will-rotation-functions" are deprecated. [So for now my solution to handle this.][1] [1]: http://stackoverflow.com/a/29772254/2242687 – MPajak Apr 21 '15 at 13:19

6 Answers6

8

Thank you for all I have found the best solution to my problem .

MyImageViewController.hidesBottomBarWhenPushed = YES ;
[self.navigationController pushViewController:MyImageViewController animated:YES];

It gave me the response I wanted . Thank you for your share

SamehDos
  • 1,183
  • 1
  • 10
  • 23
2

I think you can show it on model view controller. Put modelviewcontroller over tabbarcontroller.

FullImageView*objFullImageView = [[FullImageView alloc] initWithNibName:@"FullImageView" bundle:nil];
objFullImageView.image = OriginalImage;
UINavigationController *tempNav = [[[UINavigationController alloc] initWithRootViewController:objFullImageView] autorelease];
[objFullImageView release];
self.tabBarCtrl.modalPresentationStyle = UIModalPresentationPageSheet;
[self.tabBarCtrl presentModalViewController:tempNav animated:YES];

FullImageView.h

{  
    UIImage *image;
}
@property(nonatomic, retain) UIImage *image;

FullImageView.m

@synthesize image;

viewDidLoad /ViewWillApper
{
    //Set image in your UIImageView    
}
Mobile App Dev
  • 1,824
  • 3
  • 20
  • 45
1

I solved this problem by changing constraints.

I had a view in my tabbar viewController whose bottom constraint was given (=0) from Safe Area.bootom. This was causing white space at the bottom. Changing this constraint to (=0) from Superview.bottom solved my proble.

S.S.D
  • 1,579
  • 2
  • 12
  • 23
0

It's been quite a long time since the original post, but I thought I could jump in and add my thoughts.

Another option would be to set the option Hide bottom bar on push directly within the Storyboard for all those controllers which are pushed within a navigation controller inside a tabbar controller. This works within iOS7 simulator/targets as well, both at 3.5" and 4".

Blazor
  • 171
  • 4
  • 11
0

You can increase the height of your image view frame.

Arslan Faisal
  • 187
  • 1
  • 1
  • 5
0

After hours of research, this thread resolved my blank space issue when hidding the tabbar: hiding TabBar when rotating iPhone device to landscape

Community
  • 1
  • 1
Mart Coul
  • 490
  • 6
  • 15