Add Buttons to Navigation Bar that are aligned with the Title - swift

So I have this navigation title, and I tried to align some buttons with it using .toolbar. But Whenever I lower it with some extra padding on the top (so that they can be aligned horizontally) the buttons stop being able to be clicked. Is there some kind of area around the navigationTitle where I can't hit buttons? How do I fix this?

You can add views including buttons to the Navigation bar using .naivgationBarItems(leading: View?, center: View?, trailing: View?)

Related

Swift bar at the bottom of bar button item in toolbar

I am using a toolbar(at the bottom part of the screen, not as in the printscreen) and I am trying to add a bar at the bottom of the bar button that was last tapped, as in the printscreen(the baby blue bar on top of the blue bar).
Any idea how I could do this?
You need to do it programatically, then set the navbar y position at the bottom part, you wont be able to do it using Storyboard.

how do I have the navigationItem.titleView to be behind left and right bar button item

Is it possible to have the titleView to be behind the left and right bar button item on a navigation bar? I've set my titleView to have a width of 320 and it covers the left and right bar button item. I wonder if there is a way to move it to the back?
In my experiments, it appears that the titleView is always drawn after (above) the left and right bar button items. You could try spelunking the view hierarchy and using sendSubviewToBack:, provided that the title view is ever made part of the navigation bar's hierarchy.
If you can render the effect you're trying to achieve into an image, you could set that as the backgroundImage of the navigation bar, but this may not be practical.
Remember that you'll likely need to account for interface rotation in any case, since the navigation bar height (on iPhone) goes from 44px in portrait to 32px in landscape).

the scroll bar is hidden behind the keyboard

I have a UITableViewController with a search bar. When I touch the screen to start the search, I hide the UINavigationBar and show the scope bar search to optimize the space.
For the TableView not hide behind the keyboard and search bar, I add header and footer to the table with their respective heights.
Everything working correctly. But the scroll bar is still hiding behind the search bar and keyboard.
Any suggestions to solve this or some other way to do this whole mechanism?
Resize the table view's frame by subtracting the height of the keyboard.

UIToolbar and Flexable/Fixed bar button items

I have a toolbar, where I want to have one UIBarButtonItem centered and have another on the very right. However when I add the button on the right, my centered button gets shifted further to the left (see attached). I can't figure out how to get this resolved without using code (I would like to use interface builder only). Any ideas?
To do this in just IB, add a fixed bar button item to the very left of the bar that's the exact same width of the 'switch camera' button, followed by a flexible button, your camera icon, another flexible space, and the switch camera.
So it would look like:
|--fixed space--||--flexible space--||Camera Button||--flexible space--||switch camera|

Toolbar placement off with Interface Builder

I have a view xib that I'm manipulating through IB (for various reasons) and it will be launched as a modal view in code. I have a Toolbar at top and another one at bottom with some other UI elements in between. When I run the app, the placement of the top Toolbar isn't as I see it during the layout in IB.
In IB, the top Toolbar is placed at top below the status bar correctly and the next UI element (a label) appears below it. However, in the simulator, the top half of the Toolbar appears underneath the status bar and thus making it look cut off and there is a lot of space between the Toolbar and the label, which isn't reflected in the layout in IB.
For modal views, should the height of the view be different? If so, what does it need to be?
The view's height is set to default height value of 480.
Is the style of the status bar set to Translucent Black in IB? This causes the status bar to not consume any space and as a result "float" above the underlying Views.