Chcę zapytać, praca z dwoma lub więcej zagnieżdżonymi RelativeLayout. Pierwszy kod wygląda jak obrazek 1, kiedy dodam android:layout_alignParentRight="true"
w drugim RelativeLayout, wygląda to jak obraz 2. Chcę wyrównać tekst do drugiego RelativeLayout. Gdzie moja wina?dwa lub więcej zagnieżdżonych 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>
Zdjęcie 1:
I dodam 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>
Zdjęcie 2:
spróbować dodać do '' TextView' Androida: layout_alignParentTop = "true" ' –
najgorszy scenariusz: Dodaj' ImageView' przed 'TextView' zamiast z 'android: background =" @ drawable/picture_border_offer_first_page "'. Będą nakładać się –
@pierw wypróbowałem alightTop, to samo. – atasoyh