Jules
Jules

Reputation: 7776

iPhone, how do i make my toolbar the same black opaque as the nav bar?

I'm using... (although I've tried other things)

Before I I tried, it looked like this..

alt text

tools = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 70, 44.01)];
//tools.backgroundColor = [UIColor blackColor];
//tools.backgroundColor = [UIColor clearColor];
//tools.barStyle = UIBarStyleBlackTranslucent;
tools.barStyle = UIBarStyleBlackOpaque;

This looks like this....

alt text

How can I match the navigation bar black opaque scheme ?

Upvotes: 3

Views: 849

Answers (2)

Ryan
Ryan

Reputation: 16636

You shouldn't try to add a toolbar to a navigation bar. They're not meant to work that way. Instead, modify the navigation item for your view controller to display the controls you want.

Upvotes: 2

Greg
Greg

Reputation: 33650

Assuming you are trying to add a UIToolBar to a black opaque navigation bar as your pictures show, this blog post seems to provide the answer you're looking for:

http://blog.blackwhale.at/tag/uibarstyleblackopaque/

(Mirrored in case the blog goes away: http://miro.ir/xB8fW/blog-blackwhale-at_tag_uibarstyleblackopaque_)

It shows how to make a transparent UIToolBar that you can place on a black opaque UINavigationBar.

Upvotes: 0

Related Questions