2
votes

I have downloaded Xcode 5 GM seed and trying to run my application on it.

I have set a black image for navigation bar which works perfectly on iOS 7.

But whenever I present a view controller the navigation bar image does not get set properly. It is showing a patch.

Code :

[self.navigationController.navigationBar setBackgroundColor:[UIColor blackColor]];
[self.navigationController.navigationBar setBarTintColor:[UIColor whiteColor]];

[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"top-nav-bar.png"] forBarMetrics:UIBarMetricsDefault];

enter image description here

Has anyone encountered the same issue ?

EDIT : I have similar problem as the link below. But in my case, it appears only when presenting view controller and works perfectly when pushed.

navigation controller bar is being cut off

1

1 Answers

1
votes

You need to becareful about the following:

tintColor is the bar buttons and title color:

navigationBar.tintColor = [UIColor whitColor];

barTintColor is the bar background color:

navigationBar.barTintColor = [UIColor colorWithRed:6.0/255.0 green:12.0/255.0 blue:19.0/255.0 alpha:1.0];

translucent, It is YES by default in iOS7 :

navigationBar.translucent = NO;

Take a look at the below image from Apple:

enter image description here