bright / Cero

HTML like views for iOS
Apache License 2.0
3 stars 1 forks source link

Layout constraint - top,bottom etc require other item. #7

Closed miensol closed 9 years ago

miensol commented 9 years ago

If we use a constraint such as:

<Constraint on="top" constant="50"/>

an exception with very meaningful message is thrown: "NSInternalInconsistencyException", "Unexpected use of internal layout attribute"

miensol commented 9 years ago

I was thinking about this type of constraints and an idea came to my mind. What do you think of settings a default with value i.e <Constraint on="top" constant="50"/> would create a constraint equivalent to <Constraint on="top" constant="50" with=":superview" />. @NOtherDev @KlimczakM @mgamer @danielmakurat What do you think?

miensol commented 9 years ago

A princple of least surprise suggests that we should use :superview in suche case I suppose