Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8655851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:08:22+00:00 2026-06-12T15:08:22+00:00

Long title for hopefully a small problem. I have a UINavigationBar with a custom

  • 0

Long title for hopefully a small problem.

I have a UINavigationBar with a custom background image. My app will support landscape orientation as well as portrait. Landscape works well in the simulator for retina 3 inch and non-retina screens. However, on the retina 4 inch screen, the background image is displayed twice its size in landscape mode.

Here’s the relevant code snippet from my custom navigation controller’s init-method:

[self.navigationBar setBackgroundImage:[UIImage imageNamed:@"navbar-bg.png"] forBarMetrics:UIBarMetricsDefault];        
if (IS_IPHONE_5)
{
    [self.navigationBar setBackgroundImage:[UIImage imageNamed:@"navbar-bg-landscape-iphone5.png"] forBarMetrics:UIBarMetricsLandscapePhone];
}
else
{
    [self.navigationBar setBackgroundImage:[UIImage imageNamed:@"navbar-bg-landscape.png"] forBarMetrics:UIBarMetricsLandscapePhone];
}

IS_IPHONE_5 is a macro defined as:

#define WIDTH_IPHONE_5 568
#define IS_IPHONE_5 ([[UIScreen mainScreen] bounds].size.height == WIDTH_IPHONE_5)

Here 2 screen fragments that might explain things more clearly. When the app opens in portrait mode, everything is fine:

portrait

All blows up when changing to landscape mode:

landscape

The image sizes (in pixels, width x height) for the landscape version of the background image are:

  • navbar-bg-landscape.png: 480×44
  • navbar-bg-landscape@2x.png: 960×88
  • navbar-bg-landscape-iphone5.png: 1136×88

Or could it perhaps be a simulator only problem? (I don’t have an actual iPhone 5 right now)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T15:08:23+00:00Added an answer on June 12, 2026 at 3:08 pm

    I believe your navbar-bg-landscape-iphone5.png should actually be called navbar-bg-landscape-iphone5@2x.png and that you should continue to reference it as navbar-bg-landscape-iphone5.png in your code. Because the iPhone 5 has a retina display, iOS will look for the @2x version and use it. If it doesn’t find it, it will use the version you have mentioned and then scale it up by 2x. To avoid the 2x scale up by iOS, give it an @2x version.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(sorry about the long title) I have a custom object Person, which in turn
Long title but hopefully I can explain what I am after. I have read
If someone enters a very long title/sentence, the text will stretch across the web
Sorry for a long question and not a very descriptive title, but my problem
Whew, that was a long title. Here's my problem. I've got a template class
PROBLEM: Here's the code: import matplotlib.pyplot as plt plt.bar([1,2],[5,4]) plt.title('this is a very long
I have a container: <div id=container><h1>LONG TITLE LINE</h1></div> and css: #container { width: 50%;
Long title, but simple problem. I am trying to let a window stick to
I have a long string containing a bibliography, alternating between lines of paper-title/comma-separated-author-list, like
sorry about the long title! I have a windows server 2003. I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.