How to Get a Framelayout wrap_content till the horizontalScrollview
<pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:paddingLeft="@dimen/quickaction_shadow_horiz"
    android:paddingRight="@dimen/quickaction_shadow_horiz"&gt;

    &lt;FrameLayout
        android:id="@+id/header"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dip"&gt;
        &lt;LinearLayout
            android:id="@+id/quickaction_header"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/quickaction_top_frame"
            android:gravity="center_vertical"
            android:orientation="horizontal"&gt;

            &lt;ImageView
                android:id="@+id/quickaction_icon"
                android:layout_width="54dip"
                android:layout_height="57dip"
                android:layout_marginLeft="15dip"
                android:layout_marginTop="5dip"
                android:layout_marginBottom="5dip"
                android:scaleType="center" 
                android:visibility="gone" /&gt;

            &lt;LinearLayout
                android:id="@+id/quickaction_header_content"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:layout_marginLeft="15dip"
                android:layout_marginRight="15dip"
                android:orientation="vertical"
                android:visibility="gone"&gt;
                &lt;TextView
                    android:id="@+id/quickaction_primary_text"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:focusable="true"
                    android:focusableInTouchMode="true"
                    android:singleLine="true"
                    android:ellipsize="marquee"
                    android:textColor="@android:color/primary_text_light"
                    android:textStyle="bold"
                    android:textSize="18dip"
                    android:visibility="gone" /&gt;

                &lt;TextView
                    android:id="@+id/quickaction_secondary_text"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:textColor="@android:color/secondary_text_light"
                    android:textSize="15dip"
                    android:layout_marginTop="-3dip"
                    android:visibility="gone" /&gt;
            &lt;/LinearLayout&gt;
        &lt;/LinearLayout&gt;
    &lt;/FrameLayout&gt;

    &lt;HorizontalScrollView
        android:id="@+id/scroll"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/header"
        android:fadingEdgeLength="0dip"
        android:background="@drawable/quickaction_slider_background"
        android:scrollbars="none"&gt;

        &lt;LinearLayout
            android:id="@+id/quickaction"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingTop="4dip"
            android:paddingBottom="4dip"
            android:orientation="horizontal"&gt;

            &lt;ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/quickaction_slider_grip_left" /&gt;

            &lt;ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/quickaction_slider_grip_right" /&gt;

        &lt;/LinearLayout&gt;

    &lt;/HorizontalScrollView&gt;

    &lt;FrameLayout
        android:id="@+id/footer"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/scroll"
        android:background="@drawable/quickaction_bottom_frame" /&gt;

    &lt;!--  &lt;LinearLayout
        android:id="@+id/footer_disambig"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/scroll"
        android:background="@drawable/quickaction_disambig_bottom_bg"
        android:orientation="vertical"
        android:visibility="gone"&gt;

        &lt;ListView
            android:id="@android:id/list"
            android:layout_width="fill_parent"
            android:layout_height="0dip"
            android:layout_weight="1"
            android:background="@color/quickaction_disambig"
            android:divider="@drawable/quickaction_disambig_divider"
            android:cacheColorHint="@null" /&gt;

        &lt;CheckBox
            android:id="@+id/checkbox"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="19dip"
            android:layout_marginRight="19dip"
            android:minHeight="60dip"
            android:textColor="#f000"
            android:textStyle="bold"
            android:text="Remember Choice"
            android:textAppearance="?android:attr/textAppearanceSmallInverse"
            android:button="@drawable/quickaction_disambig_checkbox" /&gt;

    &lt;/LinearLayout&gt; --&gt;

    &lt;ImageView
        android:id="@+id/arrow_up"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/quickaction_arrow_up" /&gt;

    &lt;ImageView
        android:id="@+id/arrow_down"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="-1dip"
        android:layout_below="@id/footer"
        android:src="@drawable/quickaction_arrow_down" /&gt;

    &lt;!-- &lt;ImageView
        android:id="@+id/arrow_down_stub"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="-1dip"
        android:layout_below="@id/footer_disambig"
        android:visibility="invisible"
        android:src="@drawable/quickaction_arrow_down" /&gt;--&gt;

&lt;/RelativeLayout&gt;
</code></pre>

<p>Hello i want my Framelayout to be of same width as of the Horizontalscrollview i does not take the width of the Horizontalscrollview just stays there at the start postion if given wrap_content but takes the fill_parent i want to keep wrap_content how can i do that?</p>
