4

I am exploring Xcode6 and I found that for storyboard or xib design now it has size class introduced. I tried to create design for iPad in portrait I didn't found any specific size class layout so I decided to go with wAny - hAny.

So I got a canvas with 600x600 size. When I put a UILabel with x = 100,y = 100, w = 60,h = 21 frame. So this frame is based on 600x600 canvas. When I run the app, on screen of 768x1024 that label has same frame. Nothing changed.

So how to design layout of iPad or different sized iPhones with a fixed canvas when it doesn't change it's subview's frame based on screen size. I googles a lot for sized class but didn't got anything helpful to design layout with size class.

Only thing I found is to either disable AutoLayout or to change ViewController's simulated size to freeform and make canvas size to 768x1024 but this won't help in designing multiple sized iPhone.

Kapil Choubisa
  • 5,152
  • 9
  • 65
  • 100

2 Answers2

0

AutoLayout if your best (and only?) solution here. The fact that you resized the view in the storyboard is irrelevant. It is merely there to help you set the proper constraints from within Interface Builder.

bsarrazin
  • 3,990
  • 2
  • 18
  • 31
0

As per your question you need to refer the link as it will clarify your issue with size class and auto layout constraint.

Any-Any size class with Auto Layout

Visit link below it has the great explanation and your most of issues related to auto layout using size class will be solved:

http://mathewsanders.com/designing-adaptive-layouts-for-iphone-6-plus/

Hope this solves you problem.

Community
  • 1
  • 1
Dhaivat Vyas
  • 2,926
  • 1
  • 16
  • 26