ab11 ab11 - 1 year ago 110
Android Question

In Android, how to re-layout views?

I am adding a series of custom views to a LinearLayout. I have overridden the onMeasure method of these custom views, to return the dimensions based on certain parameters. Based on user input, I would like to change these parameters, to change the size of the views. How can I force the LinearLayout to "re-layout" it's children, to reflect the new dimensions?

Answer Source

Oh... linearLayout.requestLayout().

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download