2013-09-26 6 views
0

Je voulais mettre un ScrollView vertical J'ai inséré la table que j'ai essayée de différentes manières mais cela me donne l'erreur, j'espère que vous pouvez m'aider, salutations. mon xml:Faites défiler dans TableLayout

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

    <TableLayout 
     android:id="@+id/LayoutTabla" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/spinnerDatos" 
     android:layout_centerHorizontal="true" 
     android:layout_marginTop="39dp" > 

     <TableRow 
      android:id="@+id/tableRow1" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_weight="1" > 
     </TableRow> 

     <TableRow 
      android:id="@+id/tableRow2" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_weight="1" > 
     </TableRow> 

     <TableRow 
      android:id="@+id/tableRow3" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_weight="1" > 
     </TableRow> 

     <TableRow 
      android:id="@+id/tableRow4" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_weight="1" > 
     </TableRow> 


      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:orientation="vertical" > 
      </LinearLayout> 

    </TableLayout> 

    <TextView 
     android:id="@+id/textView1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignBaseline="@+id/btnVer" 
     android:layout_alignBottom="@+id/btnVer" 
     android:layout_alignParentLeft="true" 
     android:text="Ver datos de" /> 

    <Spinner 
     android:id="@+id/spinnerDatos" 
     android:layout_width="125dp" 
     android:layout_height="wrap_content" 
     android:layout_alignParentTop="true" 
     android:layout_centerHorizontal="true" /> 

    <Button 
     android:id="@+id/btnVer" 
     style="?android:attr/buttonStyleSmall" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_above="@+id/LayoutTabla" 
     android:layout_alignParentRight="true" 
     android:layout_toRightOf="@+id/spinnerDatos" 
     android:onClick="verTablaDatos" 
     android:text="Ver" /> 

</RelativeLayout> 

Je veux juste mettre le rouleau à <TableLayout> S'il vous plaît aidez-moi!

Répondre

1

Essayez le enrobant TableLayout dans:

<ScrollView 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:scrollbars="none" 
android:layout_weight="1"> 

    <TableLayout 
    android:id="@+id/LayoutTabla" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_below="@+id/spinnerDatos" 
    android:layout_centerHorizontal="true" 
    android:layout_marginTop="39dp" > 
+0

maintenant le problème est que le défilement non seulement abaisse complètement jusqu'à ce que le TableLayout atteint le haut de l'écran, vous savez? , Pourquoi est-ce? – Isma9

+0

Vous ne savez pas ce que vous voulez dire. Voulez-vous dire que vous ne pouvez pas voir toute la mise en page? – andysando

+0

Mon problème est que j'ai une disposition de table qui leur permet d'obtenir dynamiquement des données, c'est-à-dire de ne pas avoir une taille fixe. cet échec ne défile pas complètement. pas voir toute la table. – Isma9

Questions connexes