How can I determine the size of e.g. a LinearLayout or TableLayout
inside a screen? I get 0's when calling the getHeight()/getWidth() it
inherits from the View superclass. I need the available size, so
before any widgets are added. It is the immediate child of an
Activity, but I don't want to know how many pixels I need to substract
from the device screen for e.g. the little status bar.

I found out that by the time the Activity's onWindowFocusChanged() is
called, the sizes of the Layout are set, and can be retrieved with the
getHeight() and getWidth() methods. This is called before the widgets
onDraw() are called, but after their onMeasure() is called. So there
is still no good way to tell the widgets what size they will have.
Even if I iterate over the widgets afterwards and set their sizes,
this still has no effect.

I am sure that other people run into this problem, so I hope to get a
clean solution for this.

Thanks in advance!

Jeroen

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to