Need help in understand layout_weight="1"
<p>In the camera app layout it has:</p>

<p>camera.xml:</p>

<pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/app_root"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"&gt;
&lt;include layout="@layout/preview_frame"/&gt;
&lt;include layout="@layout/camera_control"/&gt;
&lt;/LinearLayout&gt;
</code></pre>

<p>and preview_frame.xml is </p>

<pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/frame_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_weight="1"&gt;
    .....
&lt;/RelativeLayout&gt; 
</code></pre>

<p>and camera_control.xml is:</p>

<pre><code>&lt;ControlPanelLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/control_panel"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:minHeight="76dp"
    android:background="@drawable/bg_camera_pattern"&gt;
    .....
 &lt;/ControlPanelLayout&gt;
</code></pre>

<p>My question is what is the 'layout_weight="1" ' in preview_frame.xml for?
I have read about layout_weight but most of the time it used with layout_width="0px"
And in camera_control, it does not have any layout_weight specified.</p>

<p>But in this case, it is not.</p>

<p>Thank you.</p>
