0

I am working on a universal iOS app and UI is completed based on iPhone 5 (4 inch display), now I have to make all the UI stuff look fine in older iPhones (3.5 inch displays).

I am using UIStoryboard,

AutoLayout = YES,

ARC = YES,

All UI is designed using IB in UIStoryboard.

deployment target = iOS 6+

What is the best way to manage UI for iPhone 5 (4 inch) and other iPhones (3.5 inch)

I tried Separate UIStoryboard for both screen sizes but its not working and default 4 inch UIStoryboard is gets loaded all the times.

please suggest the best way to achieve this.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
K..
  • 77
  • 9
  • You shouldn't need different storyboards, just auto-layout. Describe the problems you see. – Wain Aug 01 '13 at 06:08

2 Answers2

0

In Interface Builder, you can switch between the 3.5 inch / 4 inch layouts by pressing this button:

Storyboard

I've found it's easiest to do keep the layout in the 4 inch view and then modify the struts and springs to best accommodate the size/position. Then you can switch back to 3.5 inch and make any necessary adjustments.

John
  • 2,675
  • 2
  • 18
  • 19
  • I tried this already but layout disturbed for 4 inch screens whin i tried to run this in 4 inch screeen – K.. Aug 01 '13 at 06:22
  • This is the accepted way to manage the two layouts, but if you absolutely must create two different storyboards, just keep in mind that you now have 2 UI's to test – John Aug 01 '13 at 06:24
  • @Kamal also, struts and springs are the most pivotal part of a static UI layout – John Aug 01 '13 at 06:26
  • This only works in storyboard. – newguy Apr 22 '14 at 02:05
0

identify device 4 inch or 3.5 inch in didFinishLaunchingWithOptions

 UIStoryboard  *storyboard=nil;
    if ([UIScreen mainScreen] bounds].size.height == 568) {

        storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];

    }
    else
    {
    storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_4" bundle:nil];
    }
    [storyboard instantiateInitialViewController];
kirti Chavda
  • 3,029
  • 2
  • 17
  • 29