I have a RelativeLayout inside a LinearLayout which I use to display some data:
<LinearLayout
android:id="@+id/linearLayout4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="3dp"
android:layout_marginTop="3dp"
android:orientation="vertical" >
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:ellipsize="end"
android:maxLines="1"
android:textSize="16dp"
android:textStyle="bold" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:singleLine="true" />
<ImageView
android:id="@+id/uhr"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="left"
android:layout_marginLeft="2dp"
android:layout_toRightOf="@id/time"
android:src="@drawable/event_clock" />
</RelativeLayout>
<TextView
android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:autoLink="web|email"
android:textSize="14dp" />
</LinearLayout>
The problem is that I want my ImageView to the left and the TextView right beside it.
If I however change android:layout_toRightOf="@id/time" to android:layout_toLeftOf="@id/time" It only shows the TextView but the ImageView dissapears.
Just put the
layout_toRightOfon the TextView then: