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

AspectRatio #131

Closed
p709723778 opened this issue Dec 2, 2014 · 3 comments
Closed

AspectRatio #131

p709723778 opened this issue Dec 2, 2014 · 3 comments

Comments

@p709723778
Copy link

1
AspectRatio

How to code geometric Enlarge?

@cloudkite
Copy link
Contributor

@p709723778 Haven't tried this but possibly you could include a multiplier constraint

make.left.equalTo(view.mas_right).multipliedBy(4.0/3.0)

@haojianzong
Copy link

In storyboard, Aspect Ratio is achieved by simply setting the multiplier of width constraint to height constraint (or verse vice).

Therefore you can do it with masonry like:

make.width.equalTo( view.mas_height ).multipliedBy( 200.0 / 320.0 );

@kouky
Copy link
Contributor

kouky commented Jan 13, 2015

The multipliedBy approach worked a treat for me 👍

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

No branches or pull requests

4 participants