Segmented control in Navigation bar - ios

I need to put segmented control into navigation bar below the title and other buttons. How do I make this? Everything I found so far says you can't increase the height of navigation bar without hacks. Is it even possible?
https://drive.google.com/file/d/0B2fViGVp6nhhOEdJSU0zeWZiS1U/view?pli=1

Why don't you put both of them separately? On top navigation bar and below that UISegmentControl.
Just make sure background for UISegmentControl should be matched and aligned with UINavigation bar.
Hope that helps.

Related

Can't make UITableView appear under translucent navigation bar

I'm trying to use a translucent navigation bar and want to put my table view (in a UITableViewController) under the navigation bar but without success.
I've been searching all over the web but I'm only finding help on how to push the content below the navigation bar which is exactly the opposite of what I'm trying to do.
I have Under Top Bars checked inside my storyboard.
Please help!
set
self.automaticallyAdjustsScrollViewInsets = NO
in viewDidLoad and then check

How to give automatically top space to navigation bar in ios?

I have a UIViewController. I am designing the screen for iPhone 5s. I have a UIImageView & I am giving top space to container of 20. I also have UINavigationBar at top.So the space given of 20 is not enough. UIImageView is hidden behind the UINavigationBar. I can resolve this issue by giving much space from top. But in that case at design time my UI will not look proper. So is there any way by which space from UINavigationBar is automatically calculated?
In Attribute Inspector set Top Bar to Translucent Navigation Bar like this
then set Top Space of imageView to Top Layout Guide like,
set navigation bar type as opaque Navigation Bar so it will opaque that much space from your view controller and show your view content after navigation bar space they will not hide inside of navigation bar.
but if you set navigation bar type as Translucent Navigation bar then your content will hide inside of navigation bar so set "Opaque Navigation Bar" type. no need to do any other stuff for that.
I hope it will help you!

Hiding navigation bar with a segmented control right under the bar

Here's the set up
Navigation Bar
segmented control
Table view
I know in iOS 8 there is the navigationBar.hidesOnSwipe function that works wonders.
Is there a way, perhaps using autolayout, to also hide the segmented control as the navigationBar hides as well without writing a custom function to handle this?
Also, when I make the following setup in a storyboard, swiping the table view does not hide the navigation bar but swiping the segmented control does. But when I turn .hidesOnTap, the navigationBar hides and pulls the segmentedcontrol up
Thanks in advance

UISearchBar and UINavigationBar from navigation controller disappearing when searching

I have a UINavigationController with a UISearchBar right under the UINavigationBar. When I click in the search bar, the text and buttons on the UINavigationBar disappears, but the blank white bar still stays. I think this is because it is a navigation controller and so the navigation bar can disappear. In addition, when I start typing, the search bar disappears, but I can still type. My question: is there a way to either make the entire navigation bar disappear when I start searching or make the text on the navigation bar stay while searching, and how do I ensure the search bar does not disappear? Thanks.
self.searchController.hidesNavigationBarDuringPresentation = NO;
Figured it out. In the storyboard, I had to click on the little icon on the bottom, third from the left, then "resolve auto layout issues." Autolayout must be off for this to work

Navigation bar - why do I get borders?

I have searched but could not find a solution for this...
I have a view controller in storyboard, and I want to add a navigation/toolbar bar under the status bar with a cancel button. I can place a navigation bar using constraints, but I get unwanted borders around the navigation bar. How do I get rid of these?
Turns out that I had customized the appearance of UINavigationBar for iOS 6 and forgotten to disable that code.

Resources