Skip to content
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

Implement layout margins relative arrangement. #27

Closed

Conversation

cabeca
Copy link
Contributor

@cabeca cabeca commented Jul 20, 2015

layout margins relative arrangement

This PR implements the layout margins relative arrangement feature. It defines two new properties:

@property(nonatomic) UIEdgeInsets layoutMargins;
@property(nonatomic, getter=isLayoutMarginsRelativeArrangement) BOOL layoutMarginsRelativeArrangement;

The first one just defines the missing layoutMargins property on iOS7.
The second one switches the layout relative to margins.

I also added some buttons to visualize the feature in the example App.

bonus

  • In the process of developing this feature I also solved a small bug with the center alignment: because it didn't define any constraints relative to the edges of the stackView, the content views could easily overflow the stackView boundaries. This was fixed.
  • I also added a background view to help visualize the margins. Now that the stackView's backing layer is a CATransformLayer we could not set a backgroundColor on it to help visualize the layout. I fixed this by placing a background view behind the stackView and constraining it to have the same size and center of the stackView.

@harlanhaskins
Copy link
Contributor

I'm using this fork now, and it's very nice and works as intended. 👍

@nsomar
Copy link
Owner

nsomar commented Jul 28, 2015

This looks great!!, Sorry for the later reply, Can you add a couple of test cases to verify the margin alignment? Otherwise I will add them my self in the weekend.

@cabeca
Copy link
Contributor Author

cabeca commented Jul 30, 2015

Yes, I’ll try to add them in the weekend.

@harlanhaskins
Copy link
Contributor

Any updates? I'm anxious to try this fork with the latest updates to master 😁

@nsomar
Copy link
Owner

nsomar commented Aug 3, 2015

Hey, Me too :D.
I had little time this weekend but I definitely want to merge this asap.
I will try to add some specs tomorrow in case @cabeca cannot add them.

@cabeca
Copy link
Contributor Author

cabeca commented Aug 4, 2015

Sorry about the delay. I added the missing tests to the project.

@nsomar
Copy link
Owner

nsomar commented Aug 8, 2015

Great, this addition is super cool!
I will merge this branch by hand since I want to fix the failing test on iOS 7

@nsomar
Copy link
Owner

nsomar commented Aug 8, 2015

Merged! Thanks!

@nsomar nsomar closed this Aug 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants