I have a ListView that contains an Image on the left of two vertically-oriented TextViews using a RelativeLayout. When both TextViews have text it looks fine. Sometimes the TextView on the bottom won't have any text, and the problem is that the entire layout is several pixels above where it should be because it still reserves that space for text when there isn't any making the entire list have annoying blank gaps. I remember seeing an example of where someone made the layout not reserve the space, but I can't remember how he did it. Could somebody please enlighten me?
views:
173answers:
2
Q:
android RelativeLayout, trying to vertically center a TextView when the TextView below has no text
A:
Try to change visibility of bottom text.
When text is not present please exec setVisibility(View.INVISIBLE) or setVisibility(View.GONE) on this view.
I hope that will help.
darbat
2010-07-14 20:40:31
Here is a link to Romain Guy's explanations on thishttp://www.curious-creature.org/2009/02/22/android-layout-tricks-1/
Rasmus
2010-07-14 21:37:43