views:

131

answers:

1

Situation: I'm placing an instance of a system "item action" button into the right navigation button slot... no problems there. However, I want that button to display as just the icon WITHOUT a border around it (ie: "plain" style). Reading over documentation, it sounds like this should be a simple matter of just setting the UIBarButtonItem's "style" property to UIBarButtonItemStylePlain, like so:

UIBarButtonItem *shareButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(didPressShare)];    
    shareButton.style = UIBarButtonItemStylePlain;
    self.navigationItem.rightBarButtonItem = shareButton;
    [shareButton release];

However, when I implement the above code, the button appears in the nav bar with a border around it... apparently the system is not observing my UIBarButtonItemStylePlain setting. Any ideas as to why? Any other solutions for making a button appear a just the icon and no border around it?

Thanks in advance!

A: 

I'm sorry to tell you, but as far as I know you can't use plain style with UINavigationBar. If it is possible use UIToolbar instead.

OgreSwamp
Ah... that makes sense. It never even occurred to me that they might completely block a specific button style, but now that you mention it––that sounds remarkably like Apple and their UI consistency policies at work. Thanks for the reply!
Greg
Feel free to mark it as correct answer (check sight on the left). Or use "this answer is useful". I've seen that you never used those buttons for your prev. questions too.
OgreSwamp
Ah, thanks for the tip on stack overflow use... yeah, I'm new to the system just learning the ropes. Still cant up-vote until I get a 15 status though!
Greg