2つ以上の入れ子になったRelativeLayoutを使用して作業しています。 最初のコードは画像1のようになります。android:layout_alignParentRight="true"
を2番目のRelativeLayoutに追加すると、画像2のようになります。2番目のRelativeLayoutにテキストを正しく配置したいと思います。私の欠点はどこですか?2つ以上の入れ子のRelativeLayout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:background="@drawable/background"
android:layout_height="wrap_content"
android:id="@+id/testRL">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:id="@+id/testRotateLL"
android:background="@drawable/picture_border_offer_first_page">
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="7000TL"
android:textSize="15sp"
android:textColor="@android:color/white"
android:id="@+id/amountLayoutTV" />
</RelativeLayout>
</RelativeLayout>
写真1:
そして、私は追加android:layout_alignParentRight="true"
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:background="@drawable/background"
android:layout_height="wrap_content"
android:id="@+id/testRL">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:id="@+id/testRotateLL"
android:background="@drawable/picture_border_offer_first_page">
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="7000TL"
android:layout_alignParentRight="true"
android:textSize="15sp"
android:textColor="@android:color/white"
android:id="@+id/amountLayoutTV" />
</RelativeLayout>
</RelativeLayout>
写真2:
は 'TextView''アンドロイドに追加しよう:layout_alignParentTopは= ' "真" –
最悪のシナリオ:代わりにTextView''の前に 'ImageView'を追加します。 'android:background =" @ drawable/picture_border_offer_first_page "のようになります。彼らはオーバーレイされます –
@最初私はalightTopを試してみました。 – atasoyh