2010-05-01 4 views

Répondre

29

Si vous souhaitez aligner le texte dans votre TextView en bas à gauche, utilisez android:gravity="bottom|left". Si vous souhaitez aligner TextView en bas à gauche de son conteneur, utilisez android:layout_gravity="bottom|left".

Je suppose que vous communiquez mal vos véritables intentions, ici, cependant. Vous voulez aligner du texte en bas à gauche de quoi? L'écran? Le conteneur du texte?

Veuillez essayer d'être plus spécifique à votre question.

En bas à gauche de l'écran:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:gravity="bottom|left" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 
    <TextView android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="text"/> 
</FrameLayout> 
+0

en bas à gauche de l'écran – ryan

+0

J'ai modifié la réponse. – synic

+0

Je n'utiliserais pas de disposition d'image à cette fin. Utilisez une disposition relative à la place. – Janusz

1

Je recommande un Relative layout.

Votre vue ressemblerait à ceci:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 

    <TextView 
     android:id="@+id/label" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="Text aligned bottom left" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentBottom="true"/> 

</RelativeLayout> 
Questions connexes