views:

249

answers:

1

Hi there,

How can I change the line's color that separates the navigation bar and the view? For instance flickr changed it to gray (http://www.geardiary.com/wp-content/uploads/2009/09/Screen-shot-2009-09-08-at-8.00.06-AM.png)

By default mine is always black...

Thanks in advance for your help, nico

+2  A: 

They used a custom bottom bar and not the Apple provided ones. I dont know your setup, but if you can make or draw your own custom view however you want (you can do this), and stick buttons on it (you can do this too), then you have a toolbar

#define TOOLBAR_HEIGHT 44

CGRect frame = CGRectMake(self.view.bounds.size.height - TOOLBAR_HEIGHT, 0.0, self.view.bounds.size.width, TOOLBAR_HEIGHT);
UIView *customBottomBar = [[UIView alloc] initWithFrame:frame];
[customBottomBar setBackgroundColor: [UIColor grayColor]];

UIButton *button = [[UIButton alloc] initWithFrame:<frame goes here>]
... <button setup>
[customBottomBar addSubview:button];
[button release];

...<more buttons>
...<more buttons>

[self.view addSubview:customBottomBar];
[customBottomBar release];

And to answer your question, you can add whatever you want to any view, so while the way I just suggest is the most customizable, you might just want to place a 1pixel high colored bar at the right spot (on top of the existing toolbar) by doing this:

CGRect frame = CGRectMake(self.view.bounds.size.height - TOOLBAR_HEIGHT, 0.0, self.view.bounds.size.width, 1);
UIView *customLine = [[UIView alloc] initWithFrame:frame];
[customLine setBackgroundColor: [UIColor grayColor]];
[self.view addSubview:customLine];
[customLine release];
coneybeare
thx very much for your answer