title: Android: How to wrap content of a LinearLayout inside a TableRow vertically?
body: <p>I'm trying to add a list of tags (basically just TextViews with a background and a border applied) to a TableRow programmatically. </p>
  
  <p>I've added a LinearLayout to the TableRow to use as the container. Unfortunately I don't seem to be able to make the layout wrap vertically - i.e. if there are lots of tags to add, the list just goes horizontally off the screen.</p>
  
  <p>How can I add a list of TextView items to a LinearLayout inside a TableRow? Here's my layout:</p>
  
  <pre><code>    ...
      &lt;TableRow
          android:layout_width="wrap_content"
          android:layout_height="wrap_content" &gt;
  
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              style="@style/LabelTheme"
              android:text="@string/interests" /&gt;
  
          &lt;LinearLayout
              android:id="@+id/eventInterestContainer"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="horizontal" /&gt;
  
      &lt;/TableRow&gt;
      ...
  </code></pre>
  
  <p>Note: I added a LinearLayout because otherwise each tag's width was the width of the cell, and instead I want the width to wrap_content. Perhaps this isn't necessary though?</p>