Multiple buttons on navigation bar - cocoa-touch

I am using code from http://osmorphis.blogspot.com/2009/05/multiple-buttons-on-navigation-bar.html to implement multiple buttons in the navigation bar.
The huge problem I have now is that this construction "leaks" into the main window. By this I mean that if I press (up to about 15px) below the navigation bar the buttons still respond. How can I fix this?
Or does someone have a better way to implement multiple buttons?

It seems likely that your button bounds are extending beyond the navbar bounds. You can confirm this by setting the color of the button to something other than clear. To fix this you can either fix the frame of the buttons, or make sure clipsToBounds property of the containing view is set to YES.

Related

Is it possible to hide the bottom tab bar upon a button press and then draw it up when necessary by a simple touch?

Hey their fellow stack over flowers!
As the question states, is it possible to perform such a feat?
If possible how would you go about doing it?
So the situation we have here is that there is a drawer and on top of it lies the bottom tab bar which annoys the whole view of the screen. That's why we should find a way to hide it. Isn't it?
Here's what you've got:
What's required is, hiding the tab bar when clicking on the hamburger menu and taking it back up when you touch or press down the bottom tab area. Obviously, I went through other quality questions with qualities answers here. But nothing seems to provide a providence a least bit
Do you know any clever way to handle this?
THANKS!!
If you are using custom tabBar, you could use React.Context or some kind of global state to trigger hiding your tabBar when you press a button. I would "hide" my tabBar by rendering the tabBar as a transparent Pressable with a certain height that when you click on it, it will rerender the original tabBar. You could also use setTimeout to rehide it automatically.

How do I fix empty 44px space in iOS7 view with ViewDeckController?

I am in the process of transitioning an app to iOS7. All of the views throughout the app have a 44px empty space at the bottom that appears to be for a bottom toolbar or something, but I am not trying to display a bottom toolbar. This space also exists on views that do have a bottom toolbar and the toolbar just shows directly above it.
The red space shown is actually a view behind the black view. No matter what size I set the frame of the black view to, the red space is always shown. I am also hiding the status bar in plist, so don't know if this is an artifact from that or if it has something to do with navigation bar as they are both normally 44px in height.
I have looked at the transitioning guide and haven't found anything that's worked. Any ideas to what could be causing this and how to fix?
UPDATE:
I have tried setting edgesForExtendedLayout = UIRectEdgeAll and extendedLayoutIncludesOpaqueBars = YES (also tried NO) with no effect. When I look at the subviews of the navigation controller it shows a UIToolBar as hidden, but shows it contains a frame in the exact area the view refuses to resize to even with autolayout constraints.
UPDATE 2:
This is actually a problem with ViewDeckController (https://github.com/Inferis/ViewDeck) and the way it sets it's center view bounds.
I believe it has to do with the UINavigationBar. Try toggling the following options in Storyboard and see if it solves the problem. Namely, the 'Extend Edges' options:
These options can also be set in code with the edgesForExtendedLayout and extendedLayoutIncludesOpaqueBars properties on UIViewController.
If you are transitioning to iOS 7, you should be using an Auto Layout constraint to anchor to the Bottom Layout guide. Control drag from your view to the Bottom Layout guide and choose Vertical Space from the popup menu.
Using frames in iOS 7 is harder and is the way of the past.
Auto Layout is hard to grasp at first, but it is very powerful once you get the feel.
This is actually a problem with third party library ViewDeckController (https://github.com/Inferis/ViewDeck) and the way it sets centerViewBounds for IIViewDeckControllerIntegrated. I was able to figure it out after changing to IIViewDeckControllerContained and seeing the view sized correctly.
In IIViewDeckController.m, just return self.referenceBounds for iOS7 like it does for IIViewDeckControllerContained.

uibutton dosnt respond to touch when at a location

Bit of a strange one.
I have a UIButton which works when located anywhere on the view except the top left hand corner when in landscape mode.
I have a navigation bar with a back button nested in the same area but when the the video enters full screen and playback state changes this navigation bar is hidden.
any ideas?
As thought, the problem was occuring due to the hidden navigation bar and the navigation item located in the same place.
The only solution i can find was to remove the navigation bar from superview then add it back when needed.
Your view's hierarchy is not properly configured. To properly configure your hierarchy, you need to navigate to either the xib or storyboard that you're working with, and re-order the button so that it's on top of anything that falls within it's similar bounds. A common example is that you added a UIView, which is clear, and you had the button underneath it, and now you can't interact with it even though you can't see it.

Customise UINavigationBar to make it invisible, but keep buttons visible

I know that iOS 5 allows for UINavigationBar customisation, but I'm not sure it does what I need. I want to remove the bar entirely, or at least make it invisible, but keep the buttons (backButton, rightBarButton, etc) and replace them with my own images. I could implement actual buttons, but keeping the navBar is far more convenient as I want to use its behaviour. Is this possible? Many thanks.
You can set the navBar to hidden and handle all of the navigation yourself. The navigation controller is still there, but navigation is overridden with your custom buttons.

adding an invisible button to the background in IB

I'm working with Xcode doing a Ipad app.
i simply want user to click anywhere on screen (not counting text fields) to perform some IBAction.I'm using an invisible button that covers my whole view.
Since I have some text fields in my view,i need to add this invisible button to the background of my user interface. I cant seem to find this option in the button attributes? any help?
Just set the button's type to custom.
Did you try setting the opacity of the button to zero?
I guess i got your point. You just want to put the UIButton(invisible) on the back of all the UITextField. The simple solution to this is open the Document Window in the IB. Now expand the view tree in the list view. Just drag your UIButton above the UITextFields and set the alpha value for the button in the property to be zero.
Hope this helps!!
iPad users don't "click". They "tap" or "touch".
In Interface Builder, I believe views are constructed with a z-index from top to bottom as they appear in the document window, so dragging your button so that it appears as the first subview of your main view should be a quick fix for this.
Have you considered other approaches? This doesn't sound like standard behaviour for an app and will probably cause havoc with anybody using Voice Over. What are you trying to accomplish?