
- Forum-Beiträge: 26
30.03.2018, 22:14:53 via Website
30.03.2018 22:14:53 via Website
Hallo zusammen
ich habe ein in einem Relative Layout das Textfeld ID B an das Textfeld ID A gekoppelt.
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.vjd.pacificapps.examplerelativlayout.MainActivity">
<TextView
android:id="@+id/a"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="@android:color/darker_gray"
android:gravity="bottom"
android:text="ID A"
android:textColor="#ffffff" />
<TextView
android:id="@+id/b"
android:layout_centerInParent="**@id/a**"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_width="50dp"
android:layout_height="50dp"
android:gravity="center"
android:background="@android:color/black"
android:textColor="#ffffff"
android:text="Id B"/>
Das sieht dann wie erwarte so aus
Jetzt ändere ich für Textview android:id="@+id/a" die die Position bei xxx_center auf false
android:layout_centerHorizontal="false"
android:layout_centerVertical="false"
und erwarte eigentlich das das Textview "@+id/b mitgezogen wird, weil es ist ja an @+id/a gekoppelt.
wird es aber aus irgendeinem Grund nicht.
Die Textfelder sind wie im folgendem Bild getrennt.
Frage: Was muss ich tun damit Id B Textfeld automatisch mitgezogen wird?
Danke für das darüberschauen
schöne Ostertage
Gruss Volker
PS: nächstes mal verkleinere ich meine eingestellten Bilder. Muss jetzt weg. Die Frau ruft schon.