android - How to force ScrollView children onMeasure? -
in view hierarchy:
viewparent > scrollview > linearlayout
when dimensions change, viewparent.onmeasure calls scrollview.onmeasure witch calls linearlayout.onmeasure if scrollview.width have changed, seems normal because linearlayout constrained parent width.
how force linearlayout.onmeasure, if scrollview.width not changed ?
the solution
override scrollview.onmeasure , add linearlayout.forcelayout call:
@override protected void onmeasure(int wms, int hms) { if (getchildcount() > 0) getchildat(0).forcelayout(); super.onmeasure(wms, hms); }
Comments
Post a Comment