FluentLayout / Cirrious.FluentLayout

FluentLayout for Xamarin.iOS - sample uses MvvmCross
Microsoft Public License
148 stars 54 forks source link

Not possible to relate width to height? #35

Closed Cheesebaron closed 7 years ago

Cheesebaron commented 7 years ago

Usually if I want a square which is as high as it is wide I do something like this:

AddConstraint (NSLayoutConstraint.Create (view, NSLayoutAttribute.Height, 
    NSLayoutRelation.Equal, view, NSLayoutAttribute.Width, 1, 0));

However, I can't seem to see a way to do exactly this with FluentLayout.

I only see methods to replicate another views bounds, with the methods prefixed with WithSame or WithRelative. Or you can position the view at top, bottom, left or right of a view. However, there are no expressions to add the constraint above?

xleon commented 7 years ago
view.Width().EqualTo().HeightOf(view)
Cheesebaron commented 7 years ago

Ah! I am blind :D Thanks!