title: Tabhost tabs don't display correctly across devices
body: <p>I'm experiencing weird behavior in a tabhost across different devices. Which leads me to think there is a problem with the device (considering the one giving me trouble is running an unofficial mod) but I thought I'd ask anyway.</p>
  
  <p>My tabs are inside a HorizontalScrollView with the intention that they will extend past the allotted space but allow the user to reach them.</p>
  
  <p>Here's my code</p>
  
  <p><strong>Activity</strong></p>
  
  <pre><code>    // Set up Tabs
      TabHost tabs = (TabHost)findViewById(R.id.my_tabhost);
      tabs.setup();
  
  
      TabSpec tspec1 = tabs.newTabSpec("items");
      tspec1.setIndicator(makeTabView("Items", res.getDrawable(R.drawable.basket_icon_light)));
      tspec1.setContent(R.id.tab1);
      tabs.addTab(tspec1);
      TabSpec tspec2 = tabs.newTabSpec("customers");
      tspec2.setIndicator(makeTabView("Customers", res.getDrawable(R.drawable.customer_icon_light)));
      tspec2.setContent(R.id.tab2);
      tabs.addTab(tspec2);
      TabSpec tspec3 = tabs.newTabSpec("dept");
      tspec3.setIndicator(makeTabView("Departments", res.getDrawable(R.drawable.dept_icon_light)));
      tspec3.setContent(R.id.tab3);
      tabs.addTab(tspec3);
      TabSpec tspec4 = tabs.newTabSpec("users");
      tspec4.setIndicator(makeTabView("Users", res.getDrawable(R.drawable.user_icon_light)));
      tspec4.setContent(R.id.tab4);
      tabs.addTab(tspec4);
      tabs.setOnTabChangedListener(tabchange);
      TabSpec tspec5 = tabs.newTabSpec("terms");
      tspec5.setIndicator(makeTabView("Terms", res.getDrawable(R.drawable.terms_icon_light)));
      tspec5.setContent(R.id.tab5);
      tabs.addTab(tspec5);
      tabs.setOnTabChangedListener(tabchange);
  
  
  
  private View makeTabView(String name, Drawable draw){
      View v = View.inflate(getApplicationContext(), R.layout.custom_tab, null);
      LayoutParams lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
      lp.setMargins(1, 0, 1, 0);
      ImageView image = (ImageView) v.findViewById(R.id.tab_image);
      TextView text = (TextView) v.findViewById(R.id.tab_text);
      image.setImageDrawable(draw);
      text.setText(name);
      v.setLayoutParams(lp);
      v.setBackgroundDrawable(res.getDrawable(R.drawable.tabindicator));
      return v;
  }
  </code></pre>
  
  <p><strong>CustomTab.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal" 
    android:layout_height="match_parent" 
    android:layout_width="match_parent"&gt;
      &lt;LinearLayout android:id="@+id/linearLayout1" 
                android:orientation="vertical" 
                android:layout_marginLeft="20dp" 
                android:layout_marginRight="20dp" 
                android:layout_height="match_parent" 
                android:layout_width="match_parent"&gt;
      &lt;ImageView android:id="@+id/tab_image" 
                 android:src="@drawable/icon" 
                 android:layout_height="wrap_content" 
                 android:layout_gravity="center" 
                 android:scaleType="centerInside" 
                 android:layout_width="wrap_content"&gt;
      &lt;/ImageView&gt;
      &lt;TextView android:layout_gravity="center" 
                android:layout_height="wrap_content" 
                android:id="@+id/tab_text" 
                android:text="TextView" 
                android:layout_width="wrap_content" 
                android:layout_marginBottom="10px"&gt;
      &lt;/TextView&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>TabHost.xml</strong></p>
  
  <pre><code>    &lt;LinearLayout android:id="@+id/contain_nav" 
                    android:layout_width="fill_parent" 
                    android:layout_height="wrap_content" 
                    android:orientation="horizontal" 
                    android:background="@drawable/border_top"&gt;
          &lt;TabHost android:id="@+id/my_tabhost" 
                   android:layout_width="fill_parent" 
                   android:layout_height="wrap_content"&gt;
              &lt;LinearLayout android:weightSum="100" 
                            android:layout_height="wrap_content" 
                            android:layout_width="match_parent" 
                            android:id="@+id/linearLayout1" 
                            android:orientation="vertical"&gt;
                  &lt;LinearLayout android:layout_height="wrap_content" 
                                android:layout_width="match_parent" 
                                android:id="@+id/linearLayout3"&gt;
                      &lt;HorizontalScrollView android:layout_height="wrap_content" 
                                            android:id="@+id/horizontalScrollView2" 
                                            android:fillViewport="true" 
                                            android:layout_width="match_parent" 
                                            android:scrollbars="none"&gt;
                          &lt;TabWidget android:orientation="horizontal" 
                                     android:id="@android:id/tabs" 
                                     android:layout_height="match_parent" 
                                     android:layout_width="wrap_content"&gt;
                          &lt;/TabWidget&gt;
                      &lt;/HorizontalScrollView&gt;
                  &lt;/LinearLayout&gt;
                  &lt;FrameLayout android:layout_height="0dp" 
                               android:layout_width="match_parent" 
                               android:id="@android:id/tabcontent"&gt;
                      &lt;LinearLayout android:layout_width="match_parent" 
                                    android:layout_height="0dp" 
                                    android:id="@+id/tab1"&gt;
                      &lt;/LinearLayout&gt;
                      &lt;LinearLayout android:layout_width="wrap_content" 
                                    android:layout_height="0dp" 
                                    android:id="@+id/tab2"&gt;
                      &lt;/LinearLayout&gt;
                      &lt;LinearLayout android:layout_width="wrap_content" 
                                    android:layout_height="wrap_content" 
                                    android:id="@+id/tab3"&gt;
                      &lt;/LinearLayout&gt;
                      &lt;LinearLayout android:layout_width="wrap_content" 
                                    android:layout_height="wrap_content" 
                                    android:id="@+id/tab4"&gt;
                      &lt;/LinearLayout&gt;
                      &lt;LinearLayout android:layout_width="wrap_content" 
                                    android:layout_height="wrap_content" 
                                    android:id="@+id/tab5"&gt;
                      &lt;/LinearLayout&gt;
                  &lt;/FrameLayout&gt;
              &lt;/LinearLayout&gt;
          &lt;/TabHost&gt;
      &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>And here's what it should look like
  <a href="https://picasaweb.google.com/lh/photo/WQ_Z20LEDF14pqRe_rmeMEb1dOEZIzRgRIQzt_Z2WTI?feat=directlink" rel="nofollow">(Mot XOOM)</a>
  Here's what I keep getting
  <a href="https://picasaweb.google.com/lh/photo/uU_lytnGKK-puBRum4LZdEb1dOEZIzRgRIQzt_Z2WTI?feat=directlink" rel="nofollow">(Viewsonic Gtablet)</a></p>
  
  <p>Am I missing something I know pixel density can affect how things render, but I just don't get this.</p>