In my application, I'm displaying a fullscreen image in a 320 x 480 frame. After I display the image, I fade the navigation bar out to allow the user to see the whole picture. When the user taps in the area where the navigation bar was, I would like to bring the navigation bar back.
This is very similar to what happens in the iPhone Photos app.
Unfortunately, after I've hidden the UINavigationBar, I can't process touches on the screen where the navigation bar once was. I believe this is because the origin of the parent view is right below the navigation bar:
Nav Bar http://shortybox.com/navbar.gif
How can I process touches in this area to bring the nav bar back?
You can override hitTest:withEvent: on UIWindow. See this answer.
Are you fading out, and then removing the bar from its superview? If you just set its alpha to zero, it will still trap your clicks. Try removing it, or hiding it.
It looks like there isn't currently an easy solution to this. The default UINavigationBar is gobbling up all of my events. I ended up hiding the default navigation bar throughout my entire application, and adding a dummy UINavigationBar in interface builder.
By doing so, I lost the default "Back" buttons that come with the NavigationController, but the app is now functional.
Related
I'm wondering how to accomplish something like this on a UINavigationBar. It is the detail view of a card in the Wallet app.
Based on the documentation, I can't see how to add extra views to the navigation bar to accomplish this sort of design.
I can't see how to add extra views to the navigation bar to accomplish this sort of design.
You can’t.
In that screen shot, the navigation bar is empty except for the back button chevron. The card image is in the view controller’s view. That is why it moves up when you scroll up. If you look carefully as you scroll up, you can even see the card image passing behind the navigation bar.
I have custom views and buttons that I have added as subviews of my UINavigationBar. Their frames are set such that they begin halfway down the nav bar and extend past the normal bounds of the nav bar. I also have another subview that from time to time must be displayed as a modal looking view, but on the iPhone. To achieve this I have set his frame to 0,0,320,480 and added him as a subview of the nav bar. Everything LOOKS ok, but user interaction is disabled on the section of the view that is displayed below the nav bar, (i.e. 0,44,320,456).
Similar situations arise with my other objects. How can I enable user interaction with these views? Is there a way to do this in the opposite manner such as having a view begin in the nav controller's view and extend upward to cover the nav bar? (i.e. 0,-44,320,480) ?
Seems like a simple task but I have tried everything I can think of, including toggling showing / hiding the nav bar with / without animation to make it get out of the way, but there is a button that I need to show only as part of the navigation bar and it needs to sit on top of an actual uinavigationbar.
Any help appreciated.
Thanks,
~Arash
I have the tab bar based application and each tab is a navigation based viewcontroller sometimes when my application entered in to background, and it comes back to foreground i am missing the navigation bar in the viewcontroller.
Why it happening like this?
Check that the UINavigationController's navigationBarHidden property is set to NO. If it is check the frame of the UINavigationBar (and all other relevant UIView properties like hidden, alpha etc).
i have added back ground image to UINavigationBar in drawrect method,image added properly.and also i added right bar button item to Navigation bar in View did load method.
my problem is i navigate to detail view and when i am coming back to rootview controller, right bar button item is not visible but button action working on navigation bar right side
Can Any one help to solve this
I would remove the background image. Apple engineers told me not to do this very thing. I would use the customise options in ios5 instead.
I am working on an app which has UITabBar at the bottom of app. One of the tab holds UITableviewController and another holds UIViewController. UITableViewController is customized to hold grid of images. When I tap on these images, my App pushes another view in navigationcontroller but at this time I remove tabbar and put toolbar. So far everything works fine. But when I go back to parent view I see white space at the bottom of it. I am hiding toolbar in viewWilldisapper so that I can not see on parent view.
Can anyone tell me where I am going wrong?
Regards,
Sumit.
You don't need to hide toolBar in viewWillDisappear. When you use the method hidesBottomBarWhenPushed to hide tabbar it will automatically hides and display when you push and pop. Try removing the piece of code where you are hiding toolBar in viewWillDisappear.