title: HorizontalScrollView with centered elements
body: <p>I have a HorizontalScrollView that is filled dynamically with TextViews. Sometime there is one, two, three or more elements. What I'm looking for is a way to have the items centered regardless of the numbers of elements. </p>
  
  <p>For example, With one element:</p>
  
  <pre><code>| --------- MenuA --------- |
  </code></pre>
  
  <p>With two elements:</p>
  
  <pre><code>| ---- MenuA --- MenuB ---- |
  </code></pre>
  
  <p>With three elements:</p>
  
  <pre><code>| - MenuA - MenuB - MenuC - |
  </code></pre>
  
  <p>With five elements (MenuD and MenuE are hidden):</p>
  
  <pre><code>| MenuA - MenuB - MenuC - Me|
  </code></pre>
  
  <hr>
  
  <p>Update: Here is a simple layout with two menus. How do I center MenuA and MenuB?</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="vertical" android:layout_width="fill_parent"
      android:layout_height="fill_parent"&gt;
      &lt;HorizontalScrollView android:id="@+id/horizontalScrollView1"
          android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;
          &lt;LinearLayout android:id="@+id/linearLayout1"
              android:layout_width="fill_parent" android:layout_height="fill_parent"
              android:orientation="horizontal"&gt;
              &lt;TextView android:text="MenuA" android:id="@+id/textView1"
                  android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/TextView&gt;
              &lt;TextView android:text="MenuB" android:id="@+id/textView2"
                  android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/TextView&gt;
          &lt;/LinearLayout&gt;
      &lt;/HorizontalScrollView&gt;
  &lt;/LinearLayout&gt;
  </code></pre>