Ich habe einen einfachen Dialog, der nur zwei Optionen anzeigt ("Bearbeiten" und "Löschen"). Ich legte sein Layout in der XML-Datei fest und spezifizierte eine bestimmte Breite in den Attributen. In der App erscheint es jedoch so schmal wie "wrap_content" festgelegt wurde. Es ist gerade breit genug, um den Text zu umhüllen. Wie kann ich dieses Problem lösen? Wahrscheinlich vermisse ich etwas wirklich Einfaches. Hier ist der XML-CodeDer benutzerdefinierte Dialog scheint nicht die eingestellte Breite zu haben
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/dialog"
android:layout_width="350dp"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/editOption"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="16dp"
android:text="@string/edit"
android:textAlignment="center"
android:textColor="@color/colorPrimaryText"
android:textSize="@dimen/text_size" />
<TextView
android:id="@+id/deleteOption"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="20dp"
android:text="@string/delete"
android:textAlignment="center"
android:textColor="@color/colorPrimaryText"
android:textSize="@dimen/text_size" />
</LinearLayout>
Vielen Dank im Voraus
Es ist gerade breit genug, um den Text zu wickeln. Wie kann ich dieses Problem lösen? Sie möchten, dass der Text vertikal oder horizontal ausgerichtet wird? –
Vertikal, ich meine, eins unter dem anderen. – paola91