开发者

UIBarButtonItem does not appear to respond to "style" property

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 observi开发者_StackOverflow社区ng 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!


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜