saynomoo/mig4android — Issue #2: Widget sizes not computed correctly with nested layouts
Author: nyholku
Created: 2011-12-08 11:07:59+00:00
State: open

When nesting MigLayouts all Widgets disappear unless a few 'grow' / 'fill' constraints are sprinkled on the code.

It seems that the problem is here:

in com.saynomoo.mig4android.MigLayout.jave, around line 225 there is:

Code:
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int spec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
measureChildren(spec, spec);

although it would seem to be more logical (without really pretending to understand
all that is going on) like this:

Code:
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
measureChildren(widthMeasureSpec, heightMeasureSpec);

and indeed with this simple fix everything seems to work much better when there
are layout within layouts.

And thanks for making mig4android avaiable for all of us.
br Kusti