title: Make Tab Content Height Consistent Across All Tabs
body: <p>I have a TabHost setup with two tabs.  The height of the tab content area expands and collapses when switching between tabs to match the data displayed within it.  I'm trying to figure out how to make the height consistent so that tab1 is as tall as it needs to be and tab2 uses that same height.</p>
  
  <p>The height of the TabHost is controlled programmatically to make sure it doesn't exceed 70% of the screen height.  Tab1 contains a ScrollView so its data can be scrolled if need be.</p>
  
  <p>TabHost layout:</p>
  
  <pre><code>&lt;TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="match_parent"
    android:layout_height="match_parent"&gt;
    &lt;LinearLayout
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
      &lt;TabWidget
        android:id="@android:id/tabs"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/&gt;
      &lt;FrameLayout
        android:id="@android:id/tabcontent"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingTop="@dimen/traffic_map_bubble_padding_top"
        android:paddingRight="@dimen/traffic_map_bubble_padding_right"
        android:paddingBottom="@dimen/traffic_map_bubble_padding_bottom"
        android:paddingLeft="@dimen/traffic_map_bubble_padding_left"
        android:background="@drawable/map_ballon_bg_selector"/&gt;
    &lt;/LinearLayout&gt;
  &lt;/TabHost&gt;
  </code></pre>
  
  <p>Tab1 Layout</p>
  
  <pre><code>&lt;ScrollView 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/traffic_restriction_tab_1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"&gt;
    &lt;LinearLayout
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
      &lt;TextView
        android:id="@+id/traffic_restriction_location_1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/traffic_restriction_bg"
        android:gravity="center"
        style="@style/traffic_map_bubble_style"
        android:textStyle="bold"/&gt;
      &lt;TableLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="@dimen/traffic_map_bubble_table_margin_top"
        android:shrinkColumns="2"&gt;
          &lt;TableRow&gt;
            &lt;TextView
              android:layout_column="1"
              style="@style/traffic_map_bubble_label_style"
              android:text="@string/label_dates"/&gt;
            &lt;TextView
              android:id="@+id/traffic_restriction_date_range"
              android:layout_column="2"
              style="@style/traffic_map_bubble_style"/&gt;
            &lt;/TableRow&gt;
  
    &lt;TableRow&gt;
      &lt;TextView
        android:layout_column="1"
        style="@style/traffic_map_bubble_label_style"
        android:text="@string/label_impact"/&gt;
  
      &lt;TextView
        android:id="@+id/traffic_restriction_type"
        android:layout_column="2"
        style="@style/traffic_map_bubble_style"/&gt;
    &lt;/TableRow&gt;
  
    &lt;TableRow&gt;
      &lt;TextView
        android:layout_column="1"
        style="@style/traffic_map_bubble_label_style"
        android:text="@string/label_condition"/&gt;
  
      &lt;TextView
        android:id="@+id/traffic_restriction_detail"
        android:layout_column="2"
        style="@style/traffic_map_bubble_style"/&gt;
    &lt;/TableRow&gt;
  
    &lt;TableRow
      android:id="@+id/traffic_restriction_press_release_row"
      android:layout_marginTop="@dimen/traffic_map_bubble_table_double_space"&gt;
  
      &lt;TextView
        android:layout_column="1"
        android:visibility="invisible"/&gt;
  
      &lt;TextView
        android:id="@+id/traffic_restriction_press_release"
        android:layout_column="2"
        style="@style/traffic_map_bubble_style"/&gt;
    &lt;/TableRow&gt;
    &lt;/TableLayout&gt;
    &lt;/LinearLayout&gt;
    &lt;/ScrollView&gt;
  </code></pre>
  
  <p>Tab2 Layout</p>
  
  <pre><code>&lt;LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/traffic_restriction_tab_2"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"&gt;
  
  &lt;TextView
  android:id="@+id/traffic_restriction_location_2"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:background="@drawable/traffic_restriction_bg"
  android:gravity="center"
  style="@style/traffic_map_bubble_style"
  android:textStyle="bold"/&gt;
  
  &lt;TableLayout
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:layout_marginTop="@dimen/traffic_map_bubble_table_margin_top"
  android:shrinkColumns="2"&gt;
  
  &lt;TableRow&gt;
    &lt;TextView
      android:layout_column="1"
      style="@style/traffic_map_bubble_label_style"
      android:text="@string/label_email"/&gt;
  
    &lt;TextView
      android:layout_column="2"
      android:autoLink="email"
      style="@style/traffic_map_bubble_style"
      android:text="@string/email_public_relations"/&gt;
  &lt;/TableRow&gt;
  
  &lt;TableRow
    android:layout_marginTop="@dimen/traffic_map_bubble_table_double_space"&gt;
  
    &lt;TextView
      android:layout_column="1"
      style="@style/traffic_map_bubble_label_style"
      android:text="@string/label_phone_instate"/&gt;
  
    &lt;TextView
      android:layout_column="2"
      android:autoLink="phone"
      style="@style/traffic_map_bubble_style"
      android:text="@string/phone_public_relations_instate"/&gt;
  &lt;/TableRow&gt;
  
  &lt;TableRow
    android:layout_marginTop="@dimen/traffic_map_bubble_table_double_space"&gt;
  
    &lt;TextView
      android:layout_column="1"
      style="@style/traffic_map_bubble_label_style"
      android:text="@string/label_phone"/&gt;
  
    &lt;TextView
      android:layout_column="2"
      android:autoLink="phone"
      style="@style/traffic_map_bubble_style"
      android:text="@string/phone_public_relations"/&gt;
  &lt;/TableRow&gt;
  &lt;/TableLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>