I have a list item layout, and this layout is used in a StickyListHeaderListView and contains a vertical separator behind an image. The problem is that the view separator is never drawn on a real device despite being drawn on the preview screen.
Here is the xml layout code
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minHeight="80dp"
android:paddingLeft="@dimen/padding_medium"
android:paddingRight="@dimen/padding_medium"
tools:ignore="MissingPrefix">
<TextView
android:id="@+id/textview_date"
fontPath="@string/font_semi_bold"
android:layout_width="wrap_content"
android:maxWidth="60dp"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:gravity="center_vertical|right"
android:textAppearance="@android:style/TextAppearance.Holo.Medium"
android:textColor="#999999"
tools:text="21\nFeb" />
<RelativeLayout
android:id="@+id/container"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toRightOf="@+id/textview_date"
android:minWidth="50dp"
android:paddingLeft="@dimen/padding_extra_small"
android:paddingRight="@dimen/padding_extra_small">
<View
android:layout_width="1px"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:background="#999999" />
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentTop="true"
android:layout_marginTop="@dimen/margin_small"
android:src="@drawable/test_event_cat_1" />
</RelativeLayout>
<TextView
android:id="@+id/textview_event_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/container"
android:layout_marginTop="@dimen/margin_small"
android:textColor="#999999"
fontPath="@string/font_medium"
tools:text="ACS Nights’ Soccer Finale"
android:textAppearance="@android:style/TextAppearance.Holo.Medium" />
<TextView
android:id="@+id/textview_interval"
android:layout_width="match_parent"
android:textAppearance="@android:style/TextAppearance.Holo.Small"
android:layout_alignLeft="@+id/textview_event_name"
android:layout_below="@id/textview_event_name"
android:layout_marginTop="@dimen/margin_small"
android:textColor="#999999"
tools:text="4:00 PM - 6:00 PM"
android:layout_height="wrap_content" />
</RelativeLayout>
This code generates a correct layout in the preview window of the Android Studio
But the output on the device does not contain any vertical lines as in the preview
I tried putting the vertical line in different parts of the layout but still not shown on a real device. Any help would be appreciated.