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

java - Cast from Object to List<String>: CastClassException -

How to set a border for android Imageview in Longpress? -

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