Le texte du bouton de pas avec plusieurs lignes

Je suis en train de créer un personnalisé AlertDialog, et il y a deux boutons dans la mise en page. Toutefois, lorsque le bouton mise en page est trop longue, il ne montre que le premier mot. J'ai déjà défini dans le fichier xml singleLine = "false", mais rien.

Aussi j'ai mis dans le code, le nombre de lignes pour le bouton, dans ce cas, 2. Mais quand le texte n'est pas long, le bouton permet aux gros, pas d'emballage le contenu.

Ce que je voudrais faire est de rendre les envelopper l'ensemble du texte, même si c'est trop long par la rupture de la ligne de texte du bouton, et si le bouton de gauche obtient une plus grande hauteur, car il est enveloppant tout son texte, le bouton de son côté doit être à la même hauteur. Je sais que Android fait automatiquement, bu, je ne sais pas pourquoi sa ne se passe pas.

Dans l'image ci-dessous le texte dans le bouton doit être "C'est un bouton de test", mais il coupe le texte, et ne pas envelopper le contenu sans modifier sa largeur.

Voici une capture d'écran de la façon dont il ressemble:

Le texte du bouton de pas avec plusieurs lignes

Voici le xml de cette mise en page:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_root"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minWidth="280dip" >
<LinearLayout 
android:id="@+id/dialogTitleLayout"
android:orientation="vertical"
android:background="@drawable/header"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
style="@style/DialogText.Title"
android:id="@+id/dialogTitle"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:paddingLeft="8dip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout       
android:id="@+id/dialogContentLayout"
android:orientation="vertical"
android:background="@drawable/center" 
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
style="@style/DialogText"
android:id="@+id/dialogContent"
android:layout_width="270dip"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingTop="10dp" />
<LinearLayout 
android:id="@+id/buttonsLayout"
android:orientation="horizontal"
android:gravity="center_horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingTop="10dp" >    
<Button 
android:id="@+id/neutralButton"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/button"
android:textColor="#FFFFFF"         
android:paddingTop="8dp"
android:paddingBottom="8dp"             
android:layout_gravity="center_horizontal"
android:layout_marginRight="90dp"
android:layout_marginLeft="90dp"
android:layout_marginBottom="10dp"
android:singleLine="false" />    
<Button 
android:id="@+id/positiveButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/button"
android:textColor="#FFFFFF"             
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingLeft="10dp"
android:layout_weight="1"
android:paddingRight="10dp"
android:layout_margin="10dp"
android:singleLine="false" />    
<Button 
android:id="@+id/negativeButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/button"
android:textColor="#FFFFFF"             
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingLeft="10dp"
android:layout_weight="1"
android:paddingRight="10dp"
android:layout_margin="10dp"
android:singleLine="false" />    
</LinearLayout>
</LinearLayout>
</LinearLayout>

OriginalL'auteur Roger Câmara | 2011-08-30