views:

52

answers:

1

I have a very simple layout with two side by side textviews. Both have the same parent layout that fills the screen horizontally.

I need them to have a visible space between them so that they are visually seperated when both have text. I also need the left textview to take up about 2/3 the screen width and let the other have the rest.

This is fairly easy to do with LinearLayout and a few margin settings, but if either one of the views has no text, I need the other one to fill the entire width.

I'm not quite sure how to have the layout do that without setting the empty view's visibility to GONE in code. Is there any good, efficient way to do all of these things at once? Feel free to use any layout you wish to make it work.

A: 

have you tried this using a relative layout? there is a property for layout_alignWithParentIfMissing that might give you what you need...

Ben
That satisfies my "If either is missing.." condition but doesn't give me control over how much space each can take up if they are both visible.
CodeFusionMobile
afaik there is no silver bullet for that...
Ben