Seperator does not show in relative layout



sorry my knowledge is poor in android layout, i have a view as shown below, there is seperator (vertical divider) before imageview, i can see the seperator on graphical layout, but when i run the code, seperator is not shown on emulator and phone



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://ift.tt/nIICcg"
android:id="@+id/LinearLayout2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ecf0f1"
android:orientation="vertical"
android:padding="0sp" >

<RelativeLayout
android:id="@+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5sp" >

<TextView
android:id="@+id/product_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"

android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_toStartOf="@+id/product_price"
android:layout_toLeftOf="@+id/product_price"

android:text="product_name"
android:textColor="#2c3e50"
android:textSize="15sp"/>

<TextView
android:id="@+id/product_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

android:layout_alignParentTop="true"
android:layout_toStartOf="@+id/seperator"
android:layout_toLeftOf="@+id/seperator"

android:text="525 manat"
android:textColor="#34495e"
android:textSize="15sp"

android:layout_marginEnd="10sp"
android:layout_marginLeft="10sp"
android:layout_marginRight="5sp"
android:layout_marginStart="5sp"/>

<View
android:id="@+id/seperator"
android:layout_width="2sp"
android:layout_height="match_parent"

android:layout_alignParentBottom="true"
android:layout_alignParentTop="true"
android:layout_toStartOf="@+id/addCartBtn"
android:layout_toLeftOf="@+id/addCartBtn"

android:layout_marginEnd="2sp"
android:layout_marginStart="2sp"
android:layout_marginLeft="2sp"
android:layout_marginRight="2sp"
android:background="#000000" />

<ImageView
android:id="@+id/addCartBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"

android:layout_centerVertical="true"
android:layout_marginLeft="3sp"
android:layout_marginRight="3sp"
android:background="@null"
android:src="@drawable/addcart" />
</RelativeLayout>

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

</LinearLayout>

No comments:

Post a Comment