Note that there are some explanatory texts on larger screens.

plurals
  1. POMake an iPhone app designed for a 4-inch display compatible with 3.5 inches
    primarykey
    data
    text
    <p>My app was designed solely with a 4-inch display in mind. When run on a 3.5-inch simulator, there's .5 inches of the app missing.</p> <p>My question, then, is how can I, in Xcode 5, set a different storyboard for a different screen size? </p> <p>I know that before I could use the following piece of code:</p> <pre><code>-(void)initializeStoryBoardBasedOnScreenSize { if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) { // The iOS device = iPhone or iPod Touch CGSize iOSDeviceScreenSize = [[UIScreen mainScreen] bounds].size; if (iOSDeviceScreenSize.height == 480) { // iPhone 3GS, 4, and 4S and iPod Touch 3rd and 4th generation: 3.5 inch screen (diagonally measured) // Instantiate a new storyboard object using the storyboard file named Storyboard_iPhone35 UIStoryboard *Main_iPhone2 = [UIStoryboard storyboardWithName:@"Main_iPhone3" bundle:nil]; // Instantiate the initial view controller object from the storyboard UIViewController *initialViewController = [Main_iPhone2 instantiateInitialViewController]; // Instantiate a UIWindow object and initialize it with the screen size of the iOS device self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Set the initial view controller to be the root view controller of the window object self.window.rootViewController = initialViewController; // Set the window object to be the key window and show it [self.window makeKeyAndVisible]; } if (iOSDeviceScreenSize.height == 568) { // iPhone 5 and iPod Touch 5th generation: 4 inch screen (diagonally measured) // Instantiate a new storyboard object using the storyboard file named Storyboard_iPhone4 UIStoryboard *Main_iPhone = [UIStoryboard storyboardWithName:@"Main_iPhone" bundle:nil]; // Instantiate the initial view controller object from the storyboard UIViewController *initialViewController = [Main_iPhone instantiateInitialViewController]; // Instantiate a UIWindow object and initialize it with the screen size of the iOS device self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Set the initial view controller to be the root view controller of the window object self.window.rootViewController = initialViewController; // Set the window object to be the key window and show it [self.window makeKeyAndVisible]; } } else if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) { // The iOS device = iPad UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController; UINavigationController *navigationController = [splitViewController.viewControllers lastObject]; splitViewController.delegate = (id)navigationController.topViewController; } </code></pre> <p>}</p> <p>But the deal with Xcode 5, and what I believe the reason this code isn't working is that there is a section in under "General" within your project that establishes a storyboard as the main one throughout the specific device type.</p> <p>So, either there's a different way of doing the whole separate storyboard thing, or I'm doing something wrong with the code. That code was placed in my application delegate, so don't think I have anything wrong there.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload