1

I have UINavigationBar.

UINavigationBar *navBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0.0f, 46.0f, 320.0f, 50.0f)];
navBar.tintColor = [UIColor blackColor];
[self.view addSubview:navBar];

And I want to remove standart top shadow. How can I do this?

RomanHouse
  • 2,552
  • 3
  • 23
  • 44

1 Answers1

2

You can define a custom image for the navbar in iOS 5.0 and above:

UIImage *backgroundImage = [UIImage imageNamed:@"bevel_nav_bar.png"];
[navBar setBackgroundImage:backgroundImage forBarMetrics:UIBarMetricsDefault];
Msencenb
  • 5,675
  • 11
  • 52
  • 84
  • It's probably great :) but I interested in way without using background image. – RomanHouse Jun 03 '12 at 22:33
  • I'm unsure if there is actually a way to just remove the shadow.. maybe try something like this to just draw the color you want? (unsure if it removes shadow too) http://stackoverflow.com/questions/4904877/remove-gradient-on-uinavigationbar – Msencenb Jun 03 '12 at 22:50