# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1635161374 0 # Node ID c1482518b6434c60c2086bd6d30c45b03ecc6577 # Parent 1888d0a08365efa00a28df1641855bf46b2e090d Android: Fix weight based layout problems. To use weight, the width/height needs to be set to 0. So if we are in a situation where we can use weight... meaning the layout is in the correct direction, and we have a valid weight then set the weight and force the width or height to 0. diff -r 1888d0a08365 -r c1482518b643 android/DWindows.kt --- a/android/DWindows.kt Mon Oct 25 03:41:02 2021 +0000 +++ b/android/DWindows.kt Mon Oct 25 11:29:34 2021 +0000 @@ -1731,12 +1731,14 @@ // Handle expandable items by giving them a weight... // in the direction of the box. if (box.orientation == LinearLayout.VERTICAL) { - if (vsize != 0) { + if (vsize != 0 && weight > 0F) { params.weight = weight + params.height = 0 } } else { - if (hsize != 0) { + if (hsize != 0 && weight > 0F) { params.weight = weight + params.width = 0 } } // Gravity needs to match the expandable settings