2013-09-26 2 views
0

Я хотел поставить вертикальный ScrollView Я вставил таблицу, которую я пробовал разными способами, но это дает мне ошибку, надеюсь, вы можете мне помочь, привет. мой XML:Прокрутить в 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> 

Я просто хочу, чтобы положить свиток <TableLayout> Пожалуйста, помогите мне!

ответ

1

Try заключени в TableLayout в:

<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

теперь проблема заключается в том, что прокрутка не только снижает вниз полностью, пока TableLayout не достигнет верхней части экрана, вы знаете? , Почему это? – Isma9

+0

Не уверен, что вы имеете в виду. Вы имеете в виду, что вы не видите весь макет? – andysando

+0

Моя проблема: у меня есть табличный макет, который динамически получает данные, т. Е. Не имеет фиксированного размера. этот отказ не прокручивается полностью. не видеть всю таблицу. – Isma9

Смежные вопросы