Search code examples
iosautolayoutautoresizingmask

Any other method to resize views, other than Auto-layout


I am building an app, exclusively for iPhones and it only has a Portrait view. I have never used autolayout before and I don't think I have time to learn it now. Can I use anything else, to have my views resize themselves for the devices(iphone 4s, 5/5s, 6/6+)?


Solution

  • Remove the autolayout and sizeclasses

    enter image description here

    And use autoresizing form utilities

    enter image description here

    You can also do it by code :

    view.autoresizingMask = (UIViewAutoresizingFlexibleWidth |    
                                  UIViewAutoresizingFlexibleLeftMargin);