Here’s what I need to accomplish, the width of my menu_divider should be equal to the width of my second LinearLayout (wrap_content).
So I need to get the width of the second LinearLayout and set it to my menu_divider.
How do I do that?
Thanks.
<LinearLayout //second LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="174dp"
android:padding="8dip" >
<ImageView
android:id="@+id/itemImage"
android:layout_width="25dip"
android:layout_height="25dip"/>
<TextView
android:id="@+id/itemLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<View
android:id="@+id/menu_divider"
android:layout_width="174dp"
android:layout_height="1dp"
android:background="#96808080"
android:minWidth="174dp"
android:visibility="visible" />
I got it. I just set the width to match_parent. Btw, this layout is a for a PopUpWindow so match_parent answers it.