diogeneshamilton
diogeneshamilton

Reputation: 568

iOS5 UINavigationBar background image issues when prompt is shown

I am using the new appearance proxy in iOS 5 to style my UINavigationBar with a background image.

[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"ZSNavigationBG.png"] forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"ZSNavigationLandscapeBG.png"] forBarMetrics:UIBarMetricsLandscapePhone];

This works fine, but I need to set the prompt property of the nav bar. When I do that, the height of the nav bar increases, and my background image no longer fills that nav bar vertically, so it looks very bad.

How can I account for the height change with a prompt when using a custom background image?

Upvotes: 4

Views: 763

Answers (1)

coneybeare
coneybeare

Reputation: 33101

The image should be a stretchable image so it can extend in either direction without breaking anything.

Upvotes: 4

Related Questions