-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for UILayoutSupports (topLayoutGuide & bottomLayoutGuide) #27
Comments
It was on the todo list, thanks for reminding me! I'll have a think and come back with some suggestions. In meantime I need to fix the tests as they no longer run due to the travis upgrade. |
So I started looking into this and surprisingly it already works without any changes! If you look at the latest examples project it now has a example for using top and bottom layout guides |
Oh, awesome. Nice find! Even with the casting, that's much cleaner than having to step outside masonry to create the constraint :) In case someone finds this issue via search, here's the relevant part of the example: [topView makeConstraints:^(MASConstraintMaker *make) {
UIView *topLayoutGuide = (id)self.topLayoutGuide;
make.top.equalTo(topLayoutGuide.bottom);
make.left.equalTo(self.view);
make.right.equalTo(self.view);
make.height.equalTo(@40);
}]; Thanks @cloudkite! Feel free to close this issue. (I'm just leaving it open in case you wanted to track any additional changes you might make) |
That |
@huyz If you add |
Just in case, if someone wants to do the same on Swift, just cast topLayoutGuide to AnyObject:
|
With iOS9 they replaced the layout guides from I opened an issue for that: Issue #207 . |
The length of topLayoutGuide is difference between viewDidLoad and viewWillAppear |
Support for building constraints with topLayoutGuide and bottomLayoutGuide would be great. From what I understand, using the length property of the guide to build the constraint would require us to also monitor for status bar frame changes, and reconfigure our constraints.
This looks like it would be difficult to support without a big refactor, but if you have ideas for how you'd like this implemented, I'd be happy to work on it.
The text was updated successfully, but these errors were encountered: