开发者

android RelativeLayout, trying to vertically center a TextView when the TextView below has no text

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 ple开发者_运维问答ase enlighten me?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜