私は単純な相対レイアウトを持っています。つまり、ImageView(iv1)とTextView(tv1)がiv1の左側にあります。残念ながら、私はtv1は見ません。さらに、階層ビューアでもそれを見つける手助けをすることはできません。layout_toRightOf作品とlayout_toLeftOfは、解決する方法はありませんか?
<?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>
それはそのようになっています。私はアンドロイドを変更する場合は、しかし、
:layout_toLeftOf = "@ + ID/IV1" アンドロイドへ:layout_toRightOf = "@ + ID/IV1"、私のテキストビューはイメージビューの右側に配置されます。 toRightOfが動作し、toLeftOfが動作しないようです。 は、ここでは、どのように見えるか:
問題は何ですか? layout_toLeftOfを動作させるには?
これは機能しますが、なぜですか? – wangqi060934