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

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -