You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed the minWidth method in BlLayoutCommonConstraints class and I wondered how it worked, so can I use this to define a minimum width that would be applied to a parent with a fitContent constraint ?
I wrote this snippet that doesn't seem to work as intended at all (as it makes everything disappear) :
Although I tested it with a FrameLayout on the parent and it seemed to work so I guess it's the behavior of the BasicLayout that doesn't take the minWidth constraint.
I Also tried it with a maxWidth on the child like this :
Once again it didn't work and even with a FrameLayout the child doesn't respect the maxWidth constraint.
We can now wonder why the minWidth constraints works with a FrameLayout but not the maxWidth one.
Are those methods/constraints designed for only a few layouts ?
I'd be glad to learn more about these
Regards,
Enzo
The text was updated successfully, but these errors were encountered:
Good point, related to other recent question. The layout of both the parent and child element are who take constraints into account... or ignore them.
The default layout, BlBasicLayout, ignores the minWidth and minHeight. It ignores other attributes as well as margin.
I didn't do an exhaustive test. We can explore more on this. But I wrote this small example:
s :=BlSpacenew.
s root addChild: (a :=BlElementnewbackground:Color green;
constraintsDo: [ :c |
c horizontal matchParent.
c vertical fitContent.
c minHeight:100 ];
yourself).
s extent:200 asPoint.
s show.
shows:
and if you evaluate a layout: BlFrameLayout new, the window changes to:
because the BlFrameLayout took into account minHeight.
Hello,
I noticed the minWidth method in
BlLayoutCommonConstraints
class and I wondered how it worked, so can I use this to define a minimum width that would be applied to a parent with a fitContent constraint ?I wrote this snippet that doesn't seem to work as intended at all (as it makes everything disappear) :
Although I tested it with a FrameLayout on the parent and it seemed to work so I guess it's the behavior of the BasicLayout that doesn't take the minWidth constraint.
I Also tried it with a maxWidth on the child like this :
Once again it didn't work and even with a FrameLayout the child doesn't respect the maxWidth constraint.
We can now wonder why the minWidth constraints works with a FrameLayout but not the maxWidth one.
Are those methods/constraints designed for only a few layouts ?
I'd be glad to learn more about these
Regards,
Enzo
The text was updated successfully, but these errors were encountered: