Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a horizontal 1px 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> 
like image 365
dropsOfJupiter Avatar asked Dec 13 '10 19:12

dropsOfJupiter


People also ask

Which layout allows us to display items on the screen relative to each other?

RelativeLayout : is a ViewGroup that displays child views in relative positions.

Which type of layout allows the components in relative?

Android RelativeLayout enables you to specify how child views are positioned relative to each other. The position of each view can be specified as relative to sibling elements or relative to the parent.


1 Answers

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

<View android:background="#ffffff"        android:layout_width = "match_parent"        android:layout_height="1dp"/> 

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> 
like image 169
blindstuff Avatar answered Oct 08 '22 01:10

blindstuff