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

  • Home
  • SEARCH
  • 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 8867653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:05:57+00:00 2026-06-14T17:05:57+00:00

I started a new project in the new Xcode, and I see that my

  • 0

I started a new project in the new Xcode, and I see that my default the main window is set to 320×548. I’m fine with that, but when I test my app, a view I added to my main xib, which is supposed to be 280×280, looks more like 280×200 when testing on 3.5in devices.

I’ve tried changing the settings for that view in the xib, but nothing seems to affect it.

How do I ensure background compatibility so that in older devices the view is the same size?

Update:

When I add the the view programmatically, it all works fine, but when I add it via an outlet in my controller, it all gets squashed. I tried to force (programmatically) the view to be 280×280, but then it just distorts the content of the view. It just wants to be 280×192…

I must be doing something wrong, but I don’t know what.

  • 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-14T17:05:58+00:00Added an answer on June 14, 2026 at 5:05 pm

    I had the same issue nowadays, and fortunately found the solution. I created a simple application which contains a simple button, I wanted to set it’s size with a 10px margin around.
    The self.view.bounds returns with the actual size of the xib, if it set to for example iPhone4 retina and you test it in a different iPhone version, it will return incorrect value. Use [[UIScreen mainScreen] bounds]; instead, and substract the height of the statusbar ( [[UIApplication sharedApplication] statusBarFrame].size.height ).
    The final stuff looks like this:

    CGRect frame = [[UIScreen mainScreen] bounds];
    frame.origin.x = 10;
    frame.origin.y = 10;
    frame.size.width -= 20;
    frame.size.height -= (20 + [[UIApplication sharedApplication] statusBarFrame].size.height);
    
    button.frame = frame;
    

    I tested it on all of the device types, and it worked fine.

    (Obviously it only works when the “Use Autolayout” is unticked)

    Hope this helps.

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

Sidebar

Related Questions

I started a new IOS app project in Xcode 4.3.1. I selected tabbed application
On a new project I have started, XCode has decided that it will compile
I started a new project with XCode and I have set up the subversion
I have started a new Storyboard (iPad) based XCode project that should have a
I've recently started my new private project. The main goal which I want to
I have started working on a new Xcode project, a game to be exact.
I JUST started a new XCode Project. The code I have added in so
I have just started a new Xcode project for the first time since downloading
I have started a new project from salesforce template o XCODE, then I created
I made a new Console Application Project in XCode, and in the main.c file,

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.