Auto Layout is a constraint-based, descriptive layout system for OS X and iOS development.
107
votes
6answers
28k views
Enabling auto layout in iOS 6 while remaining backwards compatible with iOS 5
What is the best way to take advantage of the new auto layout features of iOS 6 while still providing compability with older devices on earlier versions of iOS?
140
votes
4answers
25k views
NSInvalidUnarchiveOperationException: Could not instantiate class named NSLayoutConstraint
I am very new to this. I followed Apple's tutorial step by step for the iPhone project "HelloWorld". I ran it in the iPhone 5.0 simulator and it crashed:
2012-11-02 14:46:06.782 ...
10
votes
12answers
15k views
Rotation behaving differently on iOS6
I did an App which is tab-based. Nothing needs to be on landscape mode but a couple of views. It worked OK on iOS5 and I was pretty happy with the result. However with iOS6 and without messing with ...
29
votes
15answers
9k views
“Auto Layout still required after executing -layoutSubviews” with UITableViewCell subclass
Using xCode 4.5 and iOS 6, I'm developing an app with a simple table view with custom cells. I've done this a hundred times in iOS5 and below, but for some reason the new autoLayout system is giving ...
10
votes
3answers
9k views
UIScrollView doesn't use autolayout constraints
I have a scroll view and an image view behind it and I am populating it with nibs. I am using autolayout. I have a bottom space to superview and a top space to superview on both of the views. The ...
20
votes
7answers
4k views
How do I adjust the anchor point of a CALayer, when Auto Layout is being used?
Before auto layout, you could change the anchor point of a view's layer without moving the view by storing the frame, setting the anchor point, and restoring the frame.
In an auto layout world, we ...
17
votes
5answers
7k views
UIScrollview Autolayout Issue
I have a problem with autolayout(maybe) and my scrollview!
My Problem
I scroll down
2.Then I push to another View
3.Then I go back and the scrollview looks like that and I'm not able to scroll ...
17
votes
10answers
4k views
Evenly space multiple views within a container view
Auto Layout is making my life difficult. In theory, it was going to be really useful when I switched, but I seem to fight it all of the time.
I've made a demo project to try to find help. Does anyone ...
15
votes
2answers
8k views
Embed ImageView in ScrollView with Auto Layout on iOS 6
I am trying to make very simple element with new iOS 6 SDK with auto layout.
I have an ImageView and Embed it in ScrollView. (everything build with Interface Builder). The .png file is set and ...
6
votes
2answers
777 views
UIScrollView zooming with Auto Layout
I'm trying to implement a UIScrollView the New Way, using Auto Layout. I've set up constraints from the inner view to the scroll view so that it can compute its own contentSize automatically, and that ...
5
votes
3answers
4k views
iOS AutoLayout - get frame size width
I am developing using iOS 6 auto layout
I would like to log a message displaying the frame width of the view.
I can see the textView on the screen.
But I get the width and height as zero, am I ...
1
vote
2answers
2k views
Can I use setFrame and autolayout on the same view?
I want to add padding to all of my buttons, so I subclassed UIButton, and among other changes, I wanted to add a fixed padding by using setFrame:. Everything was working, except for setFrame. I ...
9
votes
6answers
8k views
Can I disable autolayout for a specific subview at runtime?
I have a view that needs to have its frame manipulated programmatically - it's a kind of document view that wraps to its content which is then scrolled and zoomed around a superview by manipulating ...
22
votes
1answer
6k views
How do I animate constraint changes?
I'm updating an old app with an AdBannerView and when there is no ad, it slides off screen. When there is an ad it slides on screen. Basic stuff.
Old style, I set the frame in an animation block.
New ...
5
votes
1answer
9k views
Implementing auto layout for views generated programmatically
I have an app whose views are generated programmatically. Example:
-(void)loadView
{
[super loadView];
// SET TOP LEFT BTN FOR NEXT VIEW
UIBarButtonItem *topLeftBtn = [[UIBarButtonItem alloc] ...