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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:27:36+00:00 2026-05-17T06:27:36+00:00

I am using the latest Xcode and i created a view based universal app

  • 0

I am using the latest Xcode and i created a view based universal app and started building focusing on iPhone and now it is mandatory for me to put it in iPad. I didnt use the Interface builder in the development as more dynamic screen changes were expected from the beginning. In the code i have put all the screens with CGRECTMake(0,0,320,480).

Now when i tried to run the app in a iPad simulator, the app sticks to the top corners of the simulator with width as 320 and height as 480 and the rest of the screen looks white instead of coming up in the middle of the screen with a border and 2x options.

I have made the Main nib file base name (iPad) property in .plist file to my iPhone XIB name. I know this is one major reason why the app sticks to the top, but how to make this generic and make my app look proper in iPad?

Kindly help

  • 1 1 Answer
  • 1 View
  • 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-05-17T06:27:36+00:00Added an answer on May 17, 2026 at 6:27 am

    If you create your views programatically you have to set everything that has a size twice, once for iPhone/iPod and once for iPad. You can do something like:

    if ([Utils isIPad]) {
      rect = CGRectMake(0,0,640,1024);
    }
    else {
      rect = CGRectMake(0,0,320,480);      
    }
    

    [Utils isIPad] would be something like:

    + (BOOL)isIPad {
    #ifdef UI_USER_INTERFACE_IDIOM
        return (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad);
    #else
        return NO;
    #endif
    }
    

    Doing this with nibs is easier and faster, though. You just have to use the correct nib in that case. Something like:

    if ([Utils isIPad]) {
        login = [[LoginController alloc] initWithNibName:@"LoginController-iPad" bundle:nil];               
    }
    else {
        login = [[LoginController alloc] initWithNibName:@"LoginController" bundle:nil];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using latest Pyramid to build a web app. Somehow we have started
I have created a xcode project using unity3d tool, while building the project for
I've been building an iPhone game for the last couple months using XCode 3.2.5
I'm developing an iOS 4 application with latest SDK and XCode 4.2. I'm using
Currently I'm building an application using latest Prism for Silverlight 4. I've a module
Using the latest version of Resharper (4.5.x) with VS2008. Every now and then (pretty
Hey guys I'm using the latest version of XCode (3.2.2) and I've linked the
I'm developing an iPhone and iPad application with Xcode 4.2 and latest SDK. I
I am using the latest version of Xcode(4.2.1) and out of the blue, when
I have been using the new 'Build and Archive' feature of the latest Xcode

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.