How can I make navigation bar not expand when I scroll down - swift

I want to make this view. when I scroll all the way down, navigation bar is not expanded, its height is fixed.
but in my case, navigation bar is expanded when I scroll all the way down.
how can I fix it?

Related

Draggable UIView is interacting undesirably with Tab Bar

I have a UIView that I can drag around the screen via UIPanGestureRecognizer. However, when I drag it down to the bottom of the screen, the view automatically starts to squish vertically when it touches the tab bar. If I keep dragging downward, it will eventually be allowed to drag under the tab bar.
I don't want it to interact with the tab bar at all though. It should just slide under it as if it weren't there. The view controller has Extend Edges Under Top Bars and Extend Edges Under Bottom Bars checked.
Why is the view interacting with the tab bar in the first place? And how do I prevent this behavior?
Finally fixed this by unchecking the "Extend Edges Under Bottom Bars" option on the view controller. The view now slides unimpeded under the tab bar.

Swift: How can I create a secondary Bar attached under my navigation bar?

The reason I want this second bar is because I want it to stay in the totality of my project. I want to have this bar under my navigationbar and stay constant throughout the run of my project.
The top red bar is the nav bar, and the top green bar is my bar. They will have different background colors. The orange/gray box represent the screens that will appear under these bars.
What is the best way to do this?
If it were me, I'd create a view controller called something like MyToolbarViewController and add its view as a child of your navigation controller. Use Auto Layout to give it a constant height, leading, trailing and top layout guide constraints. This will allow this view to remain in place while the navigation controller performs its normal transitions in which navigation bars are replaced with that slide/fade animation. To adjust the content in each view controller pushed onto the navigation controller, adjust insets or top layout guide constraints.

XCode 6 - Navigation Bar width Button

I have an "Any Any" View Controller. There I placed a Navigation Bar and set "Horizontal Center in Container". Now it's in the middle of my View.
But when I place a Bar Button Item on the right hand side of the Navigation Bar, it only disappears in landscape on my iphone 5s. How can I set the width of the Navigation Bar to 100%?
Thank you!
I'm no Auto Layout expert, but this works for me. You should have 3 constraints for your Navigation Bar:
Trailing Space to Superview
Leading Space to Superview
Top Space to Superview
These should all have constants of zero.
This process worked for me:
Delete the constraints for the Navigation Bar
Select the Navigation Bar in the Document Outline
Click the Resolve Auto Layout Issues button |-^-| and select Add Missing Constraints.

Question About NavigationBar

When we give the option Navigation Bar with prompt for a navigation bar, its height doubles with the items like titles and button being pushed into the bottom half. Is there a way that I can keep those at the top and add a label at the bottom part?
No, you can't do that.

How to prevent subview from overlapping tab bar?

I have a view with tab bar at the bottom. This view is pushed on a navigation controller, so there is also a navigation bar at the top. Unto this view, I would like to show a table view, which I create from its own nib. When I add this view as a subview, it overlaps the tab bar.
Is there a way to make this subview automatically resize to the free space in between the top and bottom bar?
If not, what is the 'right' way of adjusting its size to fit?
-Vegar
In the interface builder make sure that you've set the navigation bar and tab bar spacers up. It should be the first list of options on the first tab in the Interface builder Properties view. This will make your view mimic the amount of space it has when loaded in the view.
From there you can also choose the option to clip the subview. The interface builder also allows you to set resize options for the view. If the subview your adding wasn't created in the interface builder you'll have to specify those options manually.
Lastly make sure that your appending the subview to the correct view, and not the tab bar controller or navigation controller.
Best bet is to make sure the subview your addings dimensions are appropriate for the amount of space you have by creating a frame using CGRect.