У меня есть такой элемент xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/messageLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:padding="5dp">
<TextView
android:id="@+id/newDayTv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:textAlignment="center"
android:textColor="@color/white"
android:visibility="gone" />
<TextView
android:id="@+id/messageData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/newDayTv"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp" />
<TextView
android:id="@+id/messageText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/messageData"
android:layout_margin="10dp" />
</RelativeLayout>
, и я хотел бы изменить его выравнивание, например layout_alignParentEnd
и аналогичное. Я видел этот вопрос , но, как вы можете видеть на этом вопросе, TS использовал два макета, и, возможно, можно будет использовать один xml и только изменить его гравитацию? Я также видел этот вопрос, но мне не удалось решить мою проблему.