0

Any pointers as to how program a crumb-trail like uinavigationbar so the buttons for each level sit together like segment control but with the border an arrow like a back button?

A picture is worth a thousand words, so... just like in this app http://itunes.apple.com/us/app/the-american-swedish-institute/id436220929?ls=1&mt=8

Thus Approved app showing crumbtrail uinavigationbar

JulianB
  • 1,686
  • 1
  • 19
  • 31

2 Answers2

0

To implement above idea you have to modify titleView of navigation bar. Please visit this for getting help about how to assign a custom view in titleView. Link shows example if search bar but you can assign any view there.

Once you are able to modify the title view you will need one image for HOME button and one image for crumb-trail. Image can be loaded in UIImageView. Now when you set frame UIImageView then it will resize the image. So you can keep height of image little smaller then height of navigation bat and width to some moderated width depending upon your data.

Follow this step for loading text into image.

  1. Take UIImageView and load image in it using this code.

    UIImageView *img = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Image.png"]];

  2. Take UILabel and set its background color to [UIColor clearColor]

  3. Set font of label using this code.

    cellText.font = [UIFont fontWithName:@"Arial-BoldMT" size:24.0f];

  4. Determine width of label as shown HERE

  5. Assign same width to you UIImageView and add UILable as subView in UIImageView.

Above steps will help you in making similar kind of GUI. Now once you can do that all you have to do is repeatedly add or remove images in titleView.

No doubt total code will be more complicated and may be difficult also but its not impossible.

Community
  • 1
  • 1
Mohammad
  • 1,636
  • 1
  • 13
  • 17
-1

You should note that Apple have this to say in the iOS Human Interface Guidelines :

Don’t create a multisegment back button.

example
(source: apple.com)

>

Creating a multisegment back button (as in the example above) causes several problems:

  • The extended width of a multisegment back button does not leave room for the title of the current screen.
  • There is no way to program such a multisegment button to indicate the selected state of an individual segment.
  • The more segments there are, the smaller the hit region for each one, which makes it difficult for users to tap a specific one.
  • Choosing which levels to display as users navigate deeper in the hierarchy is problematic.

If you think users might get lost without a multisegment back button that displays a type of breadcrumb path, it probably means that users must go too deeply into the information hierarchy to find what they need. To address this, you should flatten your information hierarchy.

I mention this because if you want to sell your app through the App Store then Apple will review it for conformance to these guidelines.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Bryan
  • 11,398
  • 3
  • 53
  • 78