TextView getHeight() problem

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

TextView getHeight() problem

Postby E-Nature » Fri Nov 27, 2009 11:12 am

I have a very odd problem - or perhaps it's just odd to me.

I have an Activity in which I have a TableLayout. I fill this table with TableRows in which I display TextViews. Imagine this as a classical table with text content. After the loop is finished I want to read all the heights in pixels of all the TextView in this table. I do this with getHeight().

The problem I have now is that ALL the values are 0 (zero) pixels. Even though I have text in the TextViews. The odd thing about this is, if I read the height of the exact same TextViews in an OnClickListener() then I do get the real height of the elements. Why is that so? I mean, nothing has changed in the height of those elements.
I really need to be able to get the height of the TextViews right after I filled the table. To get the heights upon a click is too late already for what I want to do.

Any ideas?
Thanks in advance!
dominik
User avatar
E-Nature
Experienced Developer
Experienced Developer
 
Posts: 93
Joined: Mon Nov 16, 2009 3:39 pm

Top

Postby E-Nature » Wed Dec 16, 2009 11:25 am

no one having an idea?
I am still struggling with this.
User avatar
E-Nature
Experienced Developer
Experienced Developer
 
Posts: 93
Joined: Mon Nov 16, 2009 3:39 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Exabot [Bot] and 5 guests