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 8728331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:36:55+00:00 2026-06-13T08:36:55+00:00

I have an app that is using a UITabBar and UINavigationBar . I am

  • 0

I have an app that is using a UITabBar and UINavigationBar. I am creating a UIImageView that contains my background image and then add that UIImageView to my self.view as a subview. This causes the background to appear “squished” vertically. The background image is not starting until the bottom of the NavBar and then runs down behind the TabBar.

Here’s the code I’m using to add the background:

UIImageView* backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"background.png"]];
    [backgroundView setFrame:CGRectMake(0, 0, 320, 480)];
    [self.view addSubview:backgroundView];

Any ideas about how to keep the actual size of the background would be greatly appreciated.

  • 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-13T08:36:56+00:00Added an answer on June 13, 2026 at 8:36 am

    First off, you won’t have 480 points of height to use with a UINavigationBar present on anything less than an iPhone/iPod 5. You should use self.view.frame.size.height to get the actual size. Really, you should just set the frame to the view’s bounds.

    [backgroundView setFrame:self.view.bounds];
    

    Secondly, you should set the contentMode property of the UIImageView.

    [backgroundView setContentMode:UIViewContentModeScaleAspectFill]; //Set UIViewContentModeScaleAspectFit if you want to show the full image with the potential of a letterbox
    

    That should solve your problems.

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

Sidebar

Related Questions

I have an app that will show some images using UIImageView, now I want
I have an app that plays audio using AVPlayer. I have enabled background audio
I have an app that is using twitter-bootstrap and I am trying to implement
I have an app that we are using just to serve api calls to
I have a rails app that is using Devise perfectly in development. I have
I have a WPF app that is using the MVVM pattern. Hooking up buttons
I have a mobile app that is using LinqToDatasets to update/insert into a SQL
I have a facebook app that I authenticate using a general-purpose authentification. Like this:
So I have a WIN32 app that records videos using DirectShow. Now I want
I have an ASP.NET 4 Web Forms app that is using URL Routing. I

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.