Reputation: 11935
I have a Navigation Bar and my View.
I set the frame of my view:
[myView setFrame: CGRectMake (0, -44, W, H)];
So, I have my view that is located under the navigation bar (this navigation bar is semi transparent).
Everything works fine.
In some cases, I have to hide the navigation bar and apply the gesture (tap) on my View.
self.navigationcontroller.navigationbar.hidden = YES;
When the navigation bar is hidden I can not seem to intercept the touches on my view in the area of the navigation bar (although this is hidden and can not be seen).
How can I avoid this?
Upvotes: 2
Views: 1023
Reputation: 9484
In the Navigation Controller, there is the Navigation View
on top which the ViewController's view is placed.
By shifting the Y-Axis of your ViewController's view by the height of the navigation bar, you can not shift the underlying navigation view.
This is not the way to achieve it. The navigation controller does not have the property that refers the NavigationView so we cannot shift it.
The only thing in my view you can do is to create a custom NavigationViewController, which is difficult but certainly not impossible.
Upvotes: 1