Apple's take on Custom Image as leftBarButtonItem?
I'd like to have an image to far left on my Navigation Bar, but I don't want it to function as a button, just an image really for branding purposes (well really just showing a version of my launch icon), so I'm doing this:
UIImageView *iconView=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"48 v3.png"]];
UIBarButtonItem *icon = [[UIBarButtonItem alloc] initWithCustomView:iconVie开发者_开发知识库w];
self.navigationItem.leftBarButtonItem=icon;
Which works fine. (releases not shown).
But my question is really whether this is appropriate in Apple's eyes. I haven't seen a lot of apps do this, but I have seen plenty that use a titleView that is custom and has an image. It just seems that the leftBarButtonItem placement is a good spot for a little branding icon.
What are people's thoughts on this, is it a violation of Apple's UI guidelines? Anybody get rejected for this?? How about size of the image?
If you're replacing the back button, Apple has this to say in the iOS Human Interface Guidelines:
Avoid altering the back button’s appearance or behavior. Users rely on the standard back button to help them retrace their steps through a hierarchy of information.
However, you're not replacing the functionality of a back button with this, so that warning wouldn't seem to apply.
They also say:
Avoid crowding a navigation bar with additional controls, even if there appears to be enough space. In addition to a view’s current title, the navigation bar should contain no more than the back button and one control that manages the view’s contents.
But you're not really overloading the space in the toolbar with this extra branding item, unless it reduces how legible your title is or otherwise makes your toolbar too busy.
However, even though the guidelines do not speak against it specifically, that's no guarantee that it will be accepted.
精彩评论