measuring a view before rendering it

Posted by nourdine on Stack Overflow See other posts from Stack Overflow or by nourdine
Published on 2010-05-13T13:22:28Z Indexed on 2010/05/13 13:24 UTC
Read the original article Hit count: 188

Filed under:

hello

I need to find out how big a view will be after attaching it to its parent.

I have overridden this method:

onMeasure(int, int);

but it looks like this method is invoked only when I actually add my custom view to it's container using:

addView(myView);

Do you think there is a way to get this information before rendering the view itself? Basically I need to know the actuall size before attaching it and not attach the view at all if it would take more certain amount of space.

anybody?

© Stack Overflow or respective owner

Related posts about android