iOS Navigation Bar VS UIToolBar
Asked Answered
N

3

6

According to Apple's "Human Interface Guidelines" - Navigation bars should only have one other button (apart from the standard back button)

All this is fine, but there are several apps which have numerous buttons on the top Navigation bar, such as the Facebook app (Image) My question / discussion arises from here. . .

1) Would apple accept the use of a UIToolBar in place of a Navigation bar (with a custom "back" button", which would act as a replacement for the Navigation Bar:

2) Is this how Facebook would have achieved their top bar?

3) IF I could use a toolbar instead of a Navigation Bar, i would have a small space at the top where the toolbar would overlap the "status bar" - how should i overcome this issue? - - would placing a A UIView, in that position with an embedded Toolbar be the correct solution to this issue?

All your help / comments / guides are very much appreciated

Noneffective answered 13/12, 2013 at 17:37 Comment(1)
Anyone following this thread may also find this a useful post - #18954009Noneffective
M
5

You don't have to show the navigation bar, it can be hidden (see setNavigationBarHidden:animated:). You can use UIToolbar instead but there are a lot of options for customizing the navigation bar.

You can set the leftBarButtonItem, the titleView, or the rightBarButtonItem to be a custom view as specified in the UINavigationController class reference. Those properties take a UIBarButtonItem but that doesn't have to be a button. You can create a UIBarButtonItem using initWithCustomView: to create a UIBarButtonItem with any UIView. It can be a UIView that has multiple buttons as subviews or a search bar or segmented control or whatever views you need as long as they fit and don't violate the HIG. You can do that with any of the 3 custom views on the navBar.

Muttonchops answered 13/12, 2013 at 18:20 Comment(0)
C
3

1) Would apple accept the use of a UIToolBar in place of a Navigation bar (with a custom "back" button", which would act as a replacement for the Navigation Bar:

My advice, when faced with a "should I possibly violate the specification by working around it and hoping they don't mind" decision, is "no". Are you willing to spend the time to change the code to the meet the spec if they don't accept it?

2) Is this how Facebook would have achieved their top bar?

I'm not sure this is answerable.

3) IF I could use a toolbar instead of a Navigation Bar, i would have a small space at the top where the toolbar would overlap the "status bar" - how should i overcome this issue? - - would placing a A UIView, in that position with an embedded Toolbar be the correct solution to this issue?

I created an App with a Tool Bar AND a Navigation Bar. See the screen shots (Review page) here. The Tool Bar is at the top, beneath the navigation bar. At one point, I added a feature to make a tap on the navigation bar hide/show the tool bar. But since the longer displays came out, I have removed it. Most users don't really seem to mind the extra small hit at the top as long as the display provides the information they need.

Was this helpful?

Chile answered 13/12, 2013 at 17:49 Comment(1)
It really was, I wish i could accept al three answers :) - and great app by the way -Thank youNoneffective
N
2

1) Probably. I've not seen or heard of an example of Apple bothering to reject an app that used a toolbar rather than a navigation controller. However, you may get a reviewer having a bad day that decides to reject your app for that reason; it's really impossible to know for sure, but unlikely. I will say that I've submitted an app that looks similar to apps with a navigation controller but the top bar is custom, and it was accepted.

2) The Facebook top bar is most likely totally custom. You can see that the transparency effect is unlike the standard navigation bar's transparency, and the layout is not similar to any standard apple control.

3) Align your top bar (however you do it) with the topLayoutGuide in interface builder (or in code).

Nicholle answered 13/12, 2013 at 17:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.