This is my current ListView item layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingTop="6dp"
android:paddingRight="6dp"
android:paddingBottom="6dp">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="6dp">
<TextView
android:id="@+id/departure_line"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:singleLine="true"
android:textSize="16sp"
android:textStyle="bold"
android:shadowColor="#000000"
android:shadowDx="1"
android:shadowDy="1"
android:shadowRadius="1"
android:paddingLeft="3dp"
android:paddingRight="3dp" />
</RelativeLayout>
<TextView
android:id="@+id/departure_destination"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginLeft="52dp"
android:background="#777777"
android:singleLine="true"
android:ellipsize="end"
android:textSize="16sp" />
<TextView
android:id="@+id/departure_time"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignParentRight="true"
android:textSize="16sp" />
</RelativeLayout>
My problem is that the destination TextView overlays the time TextView as you can see on the screen. How to prevent that?
Use android:layout_toLeftOf=”@+id/departure_time” in your destination or you could set them both up in a TableLayout>