1

I have a screen in landscap mode. which for example has 3 labels that I am adding through code.

 UILabel *x1 = [UILabel allow]initwithframe:CGRectMake(10, 150, 100, 40)];
 UILabel *x2 = [UILabel allow]initwithframe:CGRectMake(110, 150, 100, 40)];
 UILabel *x2 = [UILabel allow]initwithframe:CGRectMake(210, 150, 100, 40)];

now with the iOS6 and 4 inch screen, the labels are very much to the left.

Is there a neat way to align labels relatively through some percentage trick, that will position my labels accordingly in both iphone 4 and iphone 5?

Please note the above is just an example, I actually have lots of labels that I need positioned and spaced out relative to each other and the size of the screen.

NOTE

Also I do not want to resize my labels, I want to space them and move them accordingly

Anand
  • 4,182
  • 6
  • 42
  • 54
  • Have a look at UIView's class reference. You'll see the `autoresizingMask` property. –  Sep 17 '12 at 13:10
  • if you labeled this as `iOS6`, does that mean you are only supporting `iOS6+`? If so, then use `autoLayouts`, which makes it super easy. (Alternatively, you can use `autoLayouts` for only iPhone5 while keeping your old code for older devices. – Mazyod Sep 17 '12 at 13:13
  • ......aaaand you can use Apple Developer Forums as well - iOS 6 is still under NDA. –  Sep 17 '12 at 13:16

0 Answers0