Posté(e) 30 août 201115 a Bonsoir, voici mon problème illustré par les images ci-jointes. Il survient dans mon application Average ici. Quand une matière est trop longue, comme l'EPS ou mieux l'ECJS, le nom est tellement long que l'on ne voit plus la matière. Pour régler le problème en portrait, j'ai mis un maxWidth="220dp". Sauf que le problème, c'est qu'en paysage, le texte est comprimé dans cette dimension, et ce qui tiendrait sur une ligne reste en deux lignes comme en portrait. Voici le code du xml. <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:id="@+id/linearLayout" android:layout_width="fill_parent" android:layout_height="wrap_content" xmlns:android="http://schemas.android.com/apk/res/android"> <LinearLayout android:orientation="vertical" android:id="@+id/linearLayout1" android:layout_height="wrap_content" android:layout_width="wrap_content"> <TextView android:layout_height="wrap_content" android:id="@+id/nomMatiere" android:layout_width="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:text="TextView" /> <LinearLayout android:layout_width="wrap_content" android:id="@+id/linearLayout2" android:layout_height="wrap_content"> <TextView android:layout_height="wrap_content" android:id="@+id/textViewCoeff" android:layout_width="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:text="Coefficient : "/> <TextView android:layout_height="fill_parent" android:id="@+id/coefficient" android:layout_width="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:text="TextView"/> </LinearLayout> </LinearLayout> <TextView android:textAppearance="?android:attr/textAppearanceLarge" android:text="TextView" android:id="@+id/moyenne" android:layout_height="fill_parent" android:gravity="right|center" android:textSize="30dp" android:layout_gravity="right" android:layout_width="fill_parent"/> </LinearLayout> Les deux premières images sont celles avec maxWidth, les deux suivantes sans. Ce que je voudrais, c'est la première vue pour le portrait, et la troisième pour le paysage. Modifié 30 août 201115 a par Boobby69
Posté(e) 1 septembre 201115 a Pourquoi ne pas créer un layout portrait et un layout landscape ? Les deux fichiers layout ayant le même nom mais l'un étant dans le dossier "layout-port" et le second dans "layout-land". J'espère que ça peut t'aider ;)
Archivé
Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.