I have a TableLayout with a number of TableRows. Each row contains two TextViews laid out horizontally. The TextViews have fixed widths. The background of each is colored differently; the left is grey and used as a label, and the right is white and contains a value. However, the content of both is dynamic. For any given row, the content of either might be large enough to warrant wrapping to a new line.
Because the backgrounds are colored differently, I need each TextView to match its parent row in order for the colors to fill the view correctly. However, if I set a TextView's layout_height to match_parent then the TextView doesn't wrap to a newline if the content is large. In the following screenshot, there is more to the labels than just the first word that is shown:
On the other hand, if I set a TextView's layout_height to wrap_content, then if the sibling TextView's height is larger (and therefore the TableRow's height), then the first TextView's background doesn't fill the space created:
So, I want both TextView's in a TableRow to wrap to a newline if necessary, but also for the backgrounds of each to fill the space in the TableRow at all times.