android layout - Getting Height and Width for a View Failure -


i implementing new class extends checkbox

in constructor giving specific dimensions this:

setheight(size); setwidth(size); measure(size, size); 

but whenever call getheight() or getwidth() gives me 0.

am doing wrong?

it looks trying views width , height before initialized. reason why need more specific when whenever if put code in oncreate. if view visible @ try adding simple onclick , , log width , height , see happens.

hope helps , enjoy work.


Comments

Popular posts from this blog

matlab - How to equate a structure array to structure array -

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -