I have simple relative layout – an ImageView (iv1) and a TextView (tv1) to the left of iv1. Unfortunately, I see no tv1. What is more, even hierarchyViewer can’t help me find it.
<?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>
It looks like that:

However, if I change android:layout_toLeftOf="@+id/iv1" to android:layout_toRightOf="@+id/iv1", my text view becomes positioned to right of image view. It seems like toRightOf works and toLeftOf doesn’t.
Here how it looks:

What is the matter? How to make layout_toLeftOf work?
set imageview property
align_parent_right= true;