title: Understanding Layouts dimensioning
body: <p>I'm coming back to android after a lonnng break and I feel I've lost my modjo with it.</p>
  
  <p>I'm trying to build a day-planning with a relative layout that I will populate with events later.</p>
  
  <p>Here is the content view of my activity : </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="horizontal" &gt;
  
  &lt;ScrollView
      android:layout_width="600dp"
      android:layout_height="fill_parent" &gt;
  
      &lt;RelativeLayout
          android:id="@+id/day_main_relative"
          android:layout_width="match_parent"
          android:layout_height="wrap_content" &gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:orientation="horizontal" &gt;
  
              &lt;RelativeLayout
                  android:id="@+id/day_title_relative"
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="3"
                  android:background="@color/blue" &gt;
  
                  &lt;View //SEPARATOR
                      android:layout_width="2dp"
                      android:layout_height="0dp"
                      android:layout_alignParentBottom="true"
                      android:layout_alignParentRight="true"
                      android:layout_alignParentTop="true"
                      android:background="@color/black" /&gt;
              &lt;/RelativeLayout&gt;
  
              &lt;RelativeLayout
                  android:id="@+id/day_content_relative"
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="10"
                  android:background="@color/light_orange" /&gt;
          &lt;/LinearLayout&gt;
      &lt;/RelativeLayout&gt;
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p></p>
  
  <p>the Planning is inside the ScrollView. The idea is that I fill ''day_main_relative'' with lines that I want to define the height of my relative layout. I've got to keep that dynamique, so I've done something like that : </p>
  
  <pre><code>for (int i = 0; i &lt; Constants.HOUR_RANGE; i++) {
  
          // Cadrillage
          ViewGroup separator = (ViewGroup) inflater.inflate(
                  R.layout.week_separator_layout, planningMainLayout, false);
          ViewGroup.MarginLayoutParams separatorParams = (ViewGroup.MarginLayoutParams) separator
                  .getLayoutParams();
          separatorParams.setMargins(0,
                  DpHourLabel.convertValueToDpDay(i * 60), 0, 0);
          separator.setLayoutParams(separatorParams);
          planningMainLayout.addView(separator);
  </code></pre>
  
  <p>And then I'd like my Linearlayout inside of it to extend at maximum.</p>
  
  <p>To make short I'd like something like that (with a black line from the SEPARATOR "View" element of my contentView):</p>
  
  <p><img src="https://i.stack.imgur.com/3WWxX.png" alt="enter image description here"></p>
  
  <p>but I obtain this:</p>
  
  <p><img src="https://i.stack.imgur.com/nF1xj.png" alt="enter image description here"></p>