У меня есть простой относительный макет - ImageView (iv1) и TextView (tv1) слева от iv1.К сожалению, я не вижу тв1.Более того, дажеierarchyViewer не может помочь мне найти его.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:background="@android:color/white"
>
<ImageView
android:id="@+id/iv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher" />
<TextView
android:id="@+id/tv1"
android:layout_toLeftOf="@+id/iv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
</RelativeLayout>
Это выглядит так:
![enter image description here](https://i.stack.imgur.com/U0SIj.png)
Однако, если я изменю Android:layout_toLeftOf = "@ + id / iv1" для android: layout_toRightOf = "@ + id / iv1", мое текстовое представление становится расположенным справа от представления изображения.Кажется, что toRightOf работает, а toLeftOf - нет.Вот как это выглядит:
![enter image description here](https://i.stack.imgur.com/JofVe.png)
В чем дело?Как заставить layout_toLeftOf работать?