I'm trying to make the TextView containing the text "This is some long text" to float in the centre relative to the image on the left, but mine currently looks like:
This TextView can take up to 2 lines of text, so if it does have 2 lines, I hope to make it restore to the standard alignment like:
Here's my layout now:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/user_left"
android:layout_width="20dp"
android:layout_height="20dp"
android:scaleType="centerCrop"
android:src="@drawable/the_pirates"
android:layout_margin="5dp"
/>
<TextView android:id="@+id/relationship_caption"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:textSize="8dp"
android:text="This is some long text"
android:layout_toRightOf="@id/user_left"
android:layout_margin="5dp"/>
</RelativeLayout>
I've tried setting gravity
to center
, but that didn't seem to have helped.\
Thanks!