Adding a segment controller to the navigation bar in the second row

I want to add a segment controller to the navigation bar not as a title , but like this: enter image description here

How can i do this?

+7
ios uikit uinavigationcontroller uisegmentedcontrol
source share
2 answers

The problem is that it looks like it is using the title bar of the navigation bar, which is actually located where you want your segmented control to work. Instead, you need to add a tooltip to the navigation bar to increase the height of the panel, and add tooltip text above the panel's content area.

This can be done exclusively in the Builder interface, as shown in the screenshot below, or programmatically using the following code:

[self.navigationController.navigationItem setPrompt:@"some prompt text"]; 

enter image description here

+2
source share

I had to do the same and just added a segmented control to the view added below the bottom of the navigation bar.

0
source share

All Articles