2

I have searched lots for how to design navigation like given in the image.

enter image description here
I have created category for UINavigationBar like given in the following solution Custom nav bar styling - iOS

Able to increase the size of NavigationBar using below code.

CGFloat navBarHeight = 84.0f;
CGRect frame = CGRectMake(0.0f, 0.0f, 320.0f, navBarHeight);
[self.navigationController.navigationBar setFrame:frame];

But all content like (left button, right button, title) moves to bottom of bar.

When attach segment control to titleView like below

self.navigationItem.titleView = self.segmentedControl;  

All views( left button, title, right button) as liner.

I want segment control bottom of the navigation bar as shown in the image.

Community
  • 1
  • 1
Shankar Shinde
  • 141
  • 2
  • 8

3 Answers3

1

@Shankar Shinde why are you adding segment controller as navigation title view you can add below the navigation bar using storyboard: check below screen shot

enter image description here

I think you need to hide the navigation bar using following code and create view like attached screenshot let me know it's help you or not ?

 [self.navigationController.navigationBar setHidden:YES];

enter image description here

Shubham
  • 570
  • 3
  • 12
  • This is our product design decision. I have done same as you posted. if you any idea Please help. – Shankar Shinde Feb 25 '14 at 09:45
  • I have done through coding. On view added all subviews (left,right, and segment control). That view as part of viewController like `[self.view addSubview:...]`. – Shankar Shinde Feb 27 '14 at 06:23
0

Please check it out sample:

https://github.com/boctor/idev-recipes/tree/master/WoodUINavigation

It may help you :)

Gaurav
  • 299
  • 4
  • 15
0

You can use Prompt provided for navigationItem First give prompt to your navigationItem

self.navigationItem.prompt = @"";

Create a segmentcontroll

UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] initWithItems:itemArray];
segmentedControl.frame = CGRectMake(35, 200, 250, 50);
segmentedControl.segmentedControlStyle = UISegmentedControlStylePlain;
segmentedControl.selectedSegmentIndex = 1;
[self.navigationController.navigationBar addSubview:segmentedControl];
Aman Aggarwal
  • 3,754
  • 1
  • 19
  • 26