moko-widgets
moko-widgets copied to clipboard
Can't constraint two items horizontally with equal width
I want to put two items in with the same with in constraint builder but currently it seems not working.
Sample Code:
override fun createContentWidget() = with(theme) {
constraint(size = WidgetSize.AsParent) {
val loginButton = +button(
size = Const(MatchConstraint, WrapContent),
content = Text(Value.data("Login".desc() as StringDesc))
) { }
val registerButton = +button(
size = Const(MatchConstraint, WrapContent),
content = Text(Value.data("Register".desc() as StringDesc))
) { }
constraints {
loginButton topToTop root
loginButton leftToLeft root
loginButton rightToLeft registerButton offset 8
registerButton centerYToCenterY loginButton
registerButton rightToRight root
registerButton leftToRight loginButton offset 8
}
}
}
Previews:
| Android | iOS |
|---|---|
![]() |
![]() |
on both platforms we can create vertical/horizontal guidelines: https://developer.android.com/reference/android/support/constraint/Guideline https://developer.apple.com/documentation/uikit/uilayoutguide
if we add to common api guidelines support we support case from issue description

