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

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -