Pierre87 Posted June 2, 2010 Share Posted June 2, 2010 Je cherche à faire un truc tout simple : Afficher sur une ligne (horizontalement) un texte et un bouton. Le texte est collé à gauche de l'écran. Le bouton est collé à droite de l'écran. L'espace au milieu est vide. Si jamais l'écran est trop petit, le texte doit pouvoir passer à la ligne tout seul. pour le moment j'ai ça : android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/texte_tres_long" /> android:layout_width="0dip" android:layout_height="wrap_content" android:layout_weight="1" /> android:layout_width="wrap_content" android:layout_height="wrap_content" android:enabled="false" /> Ca marche bien, sauf si le texte est trop long : le texte "pousse" le bouton en dehors de l'écran. Le bouton est donc à moitié visible :( Et le texte ne revient pas à la ligne tout seul !!! Je me plante de Layout ? Je l'utilise mal ? Merci Link to comment Share on other sites More sharing options...
Pierre87 Posted June 2, 2010 Author Share Posted June 2, 2010 en fait, il suffit de dire au texte de prendre toute la place disponible, avec un layout_width à 0dip et layout_weight à 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.