views:

173

answers:

2

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?

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
Here is a link to Romain Guy's explanations on thishttp://www.curious-creature.org/2009/02/22/android-layout-tricks-1/
Rasmus
A: 

Take a look to android:layout_alignWithParentIfMissing

fedj