0

I have this UINavigationControl that has its toolbar visible and is showing the RootViewController. Then I push a new viewController into the screen but I like the toolbar to be invisible, while this other viewController is being shown.

Then, to show the viewController and hide the toolbar of the UINavigationControl I do this:

self.navigationController.toolbar.hidden = YES;
UIViewController *newVC = [[UIViewController alloc] init];
[self.navigationController pushViewController:newVC animated:YES];

The problem is that any touch on this new view controller in the are correspondent where the toolbar was visible on the last view controller is not detected.

As you know, the toolbar sits on a rectangle at the bottom of the screen, has the screen width and 44 pixels high (if I am not wrong). So, the new pushed view controller responds to touch on its full view are except those on this rectangle.

See the following picture. I have 3 buttons. Buttons 1 and 2 will respond to touches, but not button 3, because it is inside the area where the toolbar of the other view was...

And more than that, if I paint the background color of the new view with red, for example, the whole screen will be red, except for that bottom rectangle that will be white (and white is not the color of the previous view). I have checked and the view has 320 x 480...

enter image description here

any clues? thanks.

Duck
  • 34,902
  • 47
  • 248
  • 470

1 Answers1

1

I think you are looking for hidesBottomBarWhenPushed property of a UIViewController.

See this related question here.

Community
  • 1
  • 1
Sailesh
  • 25,517
  • 4
  • 34
  • 47
  • man, you are a genius! I cannot up vote you enougH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! – Duck Jun 25 '11 at 19:19