Jump to content

Problème d'orientation, de textView et d'espace sur l'écran


Boobby69

Recommended Posts

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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...