title: how do I constrain proportions with height related to width
body: <p>I have evenly spaced included LinearLayouts in a parent LinearLayout which I can do easily using weightSum and layout_weight parameters. I get a good result accept I want the spaced elements to be square. <strong><em>How do I force the height to be whatever the width ends up being after evenly spaced?</em></strong></p>
  
  <p>Note I've given the 4 included elements a weight of 10 with the spacers a weight of 1 (for a total weight sum of 45). </p>
  
  <p>Thanks very much! This has been bugging me for a while.</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/rlRaces"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:gravity="center_horizontal"
  android:orientation="horizontal"
  android:weightSum="45" &gt;
  
  &lt;LinearLayout
      android:layout_width="0dp"
      android:layout_height="fill_parent"
      android:layout_weight="1" &gt;
  &lt;/LinearLayout&gt;
  
  &lt;include
      android:layout_width="0dp"
      android:layout_height="wrap_content"
      android:layout_weight="10"
      layout="@layout/races_badge" /&gt;
  
  &lt;LinearLayout
      android:layout_width="wrap_content"
      android:layout_height="fill_parent"
      android:layout_weight="1" &gt;
  
  &lt;/LinearLayout&gt;
  
  &lt;include
      android:layout_width="0dp"
      android:layout_height="wrap_content"
      android:layout_weight="10"
      layout="@layout/races_badge" /&gt;
  
  &lt;LinearLayout
      android:layout_width="wrap_content"
      android:layout_height="fill_parent"
      android:layout_weight="1" &gt;
  
  &lt;/LinearLayout&gt;
  
  &lt;include
      android:layout_width="0dp"
      android:layout_height="wrap_content"
      android:layout_weight="10"
      layout="@layout/races_badge" /&gt;
  
  &lt;LinearLayout
      android:layout_width="wrap_content"
      android:layout_height="fill_parent"
      android:layout_weight="1" &gt;
  
  &lt;/LinearLayout&gt;
  
  &lt;include
      android:layout_width="0dp"
      android:layout_height="wrap_content"
      android:layout_weight="10"
      layout="@layout/races_badge" /&gt;
  
  &lt;LinearLayout
      android:layout_width="wrap_content"
      android:layout_height="fill_parent"
      android:layout_weight="1" &gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>