Support Center

horizontal 1px white line above image view in a relative layout



How do I add a horizontal 1px white line above image view in a relative layout?

<RelativeLayout
android:id="@+id/widget38"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="108px"
android:layout_y="87px"
>  
<ImageView
android:id="@+id/widget39"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
>  
</ImageView>  
</RelativeLayout>

 
 
imported on 5/10/2012 6:17:22 PM

Accepted answer:

Just add the following line in your XML where ever you want it.

<View android:background="#ffffff" android:layout_width = "fill_parent" android:layout_height="1dip" android:layout_centerVertical ="true" android:layout_above="@id/your_image_view_id"/>

Edit: Try this:

<RelativeLayout
android:id="@+id/widget38"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="108px"
android:layout_y="87px"
>
<View android:id="@+id/separator" 
 android:background="#ffffff" 
 android:layout_width = "fill_parent"
 android:layout_height="1dip"
 android:layout_centerVertical ="true"
 android:layout_alignParentTop="true"/>
<ImageView
 android:id="@+id/widget39"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:layout_below="@id/separator"
 android:layout_alignParentRight="true"
/>  
</RelativeLayout>

 
 
imported on 5/10/2012 6:17:22 PM

Last Updated: May 10, 2012 06:18PM EDT

Customer service software powered by Assistly Inc.