Muhammad Umar
Muhammad Umar

Reputation: 11782

Autolayout and ios5

I am using storyboards. I have used auto layout but its not working with ios5 and give crashes so I want to remove it. However, How can I uncheck the auto layout. But if I uncheck auto layout, How can i set my screens for both iPhone 4 and 5

Regards

Upvotes: 2

Views: 2618

Answers (3)

MaheshShanbhag
MaheshShanbhag

Reputation: 1494

For the use the Auto Layout use the springs in the story board for each view depending on how you want to resize them! Naturally you will need

    view.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleWidth

In the StoryBoard when you set a string or strut that means you are fixing that distance eg: if you select the bottom spring the distance of the view from the bottom is fixed which is same as the above UIViewAutoresizingFlexibleTopMargin.

Upvotes: 0

David Haynes
David Haynes

Reputation: 933

You can disable autolayout in IB but set the constraints programatically in the view controller, based on whether the iOS version on the device supports it or not by, for example, checking if the NSLayoutConstraint class can be found:

if (NSClassFromString(@"NSLayoutConstraint")) {
    //create constraints
}

More info on creating the actual constraints can be found here: http://www.techotopia.com/index.php/Implementing_iOS_6_Auto_Layout_Constraints_in_Code

Upvotes: 2

AFraser
AFraser

Reputation: 1006

You can uncheck auto layout from the Storyboard Utilities tab. If you aren't using auto layout you can use strings and structs or make adjustments programatically.

enter image description here

Upvotes: 1

Related Questions