2

I have custom UINavigationBar and it's currently look like this:

enter image description here

I want to make the bar items at top position and the UISegmentControlat the bottom.

I try so far this in layoutSubviews method:

    NSArray *classNamesToReposition = @[@"UINavigationButton"];

    for (UIView *view in [self subviews]) {

        if ([classNamesToReposition containsObject:NSStringFromClass([view class])]) {

            CGRect frame = [view frame];
            frame.origin.y -= 100;

            [view setFrame:frame];
        }
    }

But I feel like it's a hack and not the proper way (since UINavigationButton is private API :/ )

How can I make the bar items not stick to the bottom on the UINavigationBar?

Note: I m aware of Apple's example

gran33
  • 12,421
  • 9
  • 48
  • 76
  • y u r not tried with navigation bar with scope bar – Anbu.Karthik May 03 '16 at 14:44
  • @Anbu.Karthik I didn't understand your comment – gran33 May 03 '16 at 14:45
  • @Anbu.Karthik I would like navigation bar like Apple's Health app https://cdn3.vox-cdn.com/thumbor/DBEUN7QACePB2O40ajVjDKuvl2Y=/cdn0.vox-cdn.com/uploads/chorus_asset/file/1396490/IMG_0055.0.PNG – gran33 May 03 '16 at 14:46
  • see here: http://stackoverflow.com/questions/21887252/uisegmentedcontrol-below-uinavigationbar-in-ios-7 – MrTJ May 03 '16 at 14:54

0 Answers0