title: How to achieve a LinearLayout with fixed percentage width like this?
body: <p>I am trying to achieve the following layout for a CardView:</p>
  
  <p><a href="https://i.stack.imgur.com/jzg8j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jzg8j.png" alt="What I want"></a></p>
  
  <p><strong>Each one is a different CardView</strong></p>
  
  <p>I would like every CardView to have the same "columns" width. I know little about the <strong>weight</strong> property and I guess I am using it wrong. As far as I have read, the weight property will tell the "priority" of the elements to ocuppy space. I have tried this solution:</p>
  
  <pre><code>&lt;android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="100dp"
  android:layout_marginBottom="2dp"
  android:layout_marginTop="2dp"
  android:layout_marginLeft="5dp"
  android:layout_marginRight="5dp"
  android:id="@+id/main_flat_item"
   &gt;
  
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="horizontal"&gt;
  
      &lt;com.example.myapp.VerticalTextView
          android:text="CODE"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:padding="3dp"
          android:background="@color/td_main_blue"
          android:layout_gravity="center"
          android:gravity="center"
          android:textColor="@color/white" /&gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:layout_gravity="center"
          android:gravity="center"
          android:text="Title"
          android:textSize="20sp"
          android:padding="5dp"
          android:layout_weight="0.5"
          /&gt;
  
      &lt;View
          android:layout_width="1dp"
          android:layout_height="70dp"
          android:layout_gravity="center"
          android:background="@color/grayE" /&gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:orientation="vertical"
          android:layout_gravity="center"
          android:gravity="center"
          android:layout_weight="0.3"&gt;
  
          &lt;LinearLayout
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:orientation="vertical"&gt;
  
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Taxa compra"
                  android:textSize="12sp"
                  android:textColor="@color/grayB"/&gt;
  
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Taxa Compra"
                  android:textSize="16sp"
                  android:textColor="@color/td_green"/&gt;
  
          &lt;/LinearLayout&gt;
  
  
          &lt;LinearLayout
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:orientation="vertical"&gt;
  
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Taxa venda"
                  android:textSize="12sp"
                  android:textColor="@color/grayB"/&gt;
  
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Taxa Venda"
                  android:textSize="16sp"
                  android:textColor="@color/td_red" /&gt;
  
          &lt;/LinearLayout&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;View
          android:layout_width="1dp"
          android:layout_height="70dp"
          android:layout_gravity="center"
          android:background="@color/grayE" /&gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_weight="0.2"
          android:layout_gravity="center"
          android:gravity="center"&gt;
  
          &lt;CheckBox
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:button="@drawable/star_checkbox" /&gt;
  
      &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  
  
  &lt;/android.support.v7.widget.CardView&gt;
  </code></pre>
  
  <p>But altough I have set some weight properties I end up with things like:</p>
  
  <p><a href="https://i.stack.imgur.com/8fJhb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8fJhb.png" alt="Result example :( "></a></p>
  
  <p>So:</p>
  
  <ul>
  <li>Do I have to set weight to all of my childrens inside de LinearLayout? What do I do with the "fixed" width elements (like the left bar and the line separator).
  
  <ul>
  <li>Is there a better way to do this?</li>
  </ul></li>
  </ul>
  
  <p>Thanks in advance.</p>