Je ne parviens pas à placer ma TableLayout à l'intérieur de l'écran when the text cell is large
, malgré le texte inside the cell
.Problèmes de mise en page de mise en page de tableau Android
Ceci est ma TableLayout. Une simple table à deux rangées et deux colonnes. Les cellules de la colonne de gauche sont multiline
. Si le texte de l'une de ces cellules est assez grand pour se décomposer en deux lignes, la colonne est étirée pour remplir tout l'écran et les colonnes de droite sont expulsées de l'écran.
Pourquoi? Comment puis-je forcer la table entière à rester à l'intérieur de l'écran? Tout indice est le bienvenu.
Mon TableLayout est la suivante:
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/myTableLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TableRow>
<TextView
android:text="Account 4 with a very large name to see if it breaks on two or more lines"
android:singleLine="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
</TextView>
<TextView
android:text="$400.00"
android:gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
</TextView>
</TableRow>
<TableRow>
<TextView
android:text="Account 5"
android:singleLine="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
</TextView>
<TextView
android:text="$400.00"
android:gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
</TextView>
</TableRow>
</TableLayout>
Le code pour afficher la mise en page est simple:
public class AccountBrowserTest
extends Activity
{
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
this.setContentView(R.layout.accountbrowser_test);
}
}
et ce que cela signifie exactement? Comment avez-vous compris que c'est la solution? – Paul