Wie kann ich meine TextView-Positionierung ansprechen lassen?
In dem angezeigten Bild, die schwarze Sprechblase und der rote Hintergrund dahinter ist ein einziges ImageView
, die die Breite eines vertikalen Handy-Bildschirm überspannt. Das "Hallo" ist ein TextView
und das Layout ist relativ. Mithilfe von Rändern konnte ich das "Hallo" in der Sprechblase in meinem Android-Emulator positionieren - aber die Positionierung ist deaktiviert, wenn ich ein anderes Telefon emuliere.
- Gibt es einen besseren Weg, um mein
TextView
- ist es eine Möglichkeit, es als Reaktion auf machen zu positionieren (so dass das Hallo ist immer in die Sprechblase, egal, was das Gerät)?
Hier ist meine xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/relativeLayout">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/mainGraphic"
android:src="@drawable/finished2"
android:layout_marginBottom="97dp"
android:layout_above="@+id/enterValue"
android:layout_alignParentStart="true" />
<TextView
android:maxWidth="200dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Medium Text"
android:id="@+id/helloText"
android:textColor="#FFFFFF"
android:layout_marginEnd="29dp"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="45dp" />
</RelativeLayout>
ist das 9-Patch-Bild? –