Monday, September 20, 2010

[android-developers] Matching TextView heights

I have two vertical TableLayouts containing rows of TextViews
separated by some graphics. Something like this:

R-L Graphics R-R
R-L R-R
R-L R-R
R-L R-R
R-L R-R

The R-R TextViews have a fixed width, which means they grow vertically
when the text is longer than will fit in the width. The text is set at
runtime so this height is not known in advance. I want the height of
the R-L rows to exactly match the height of the R-R rows with the R-R
rows being the reference source for the height.

Once I do a TextView.setText and a TextView.setWidth on the R-R
TextViews, the height of those TextViews should be determined. Then I
can do a TextView.setMinHeight on the R-L TextViews. But I'm having
trouble getting the height value from the R-R TextViews. The
TextView.getHeight method returns zero.

Any ideas?

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate