In iOS 7, we can now add a constraint between a view and the top layout guide, which I think is very useful to solve the status bar offset issue in iOS7(especially when ther
Here is my alternative solution.
Find a UIView as a pivot, set its top layout constraint a fixed vertical space to container's top.
Control-Drag this layout constraint as an IBOutlet, such as
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *topLayoutConstraint;
Finally, just override viewWillLayoutSubviews method of UIViewController like following
- (void)viewWillLayoutSubviews
{
[super viewWillLayoutSubviews];
self.topLayoutConstraint.constant = [self.topLayoutGuide length] + YOUR_TOP_CONSTRSINT;
}
All the other views' top constraint are based this pivot view, all done :)