Android TableLayout innen ScrollView

Möchte ich sowohl die ScrollView TableLayout auf der gleichen Höhe wie der Bildschirm, aber whyy Tabelle ist nur die Hälfte des Bildschirms, während ScrollView ist die volle Bildschirm als gedacht.

Ich habe versucht, ändern der Höhe von Tisch und Zeilen wie wrap_content, aber mit gleichen Ergebnis. Zudem verändert sich die Höhe der Tabelle als fester Höhe (z.B. 900dp) ist nicht so gut funktioniert. Auch die Letzte Zeile Höhe zeigt nicht die volle Bewertung bar. Scheint, wie Tabelle wird gezwungen zu haben, die bestimmte Breite.

Wenn ich löschen ScrollView, funktioniert es Prima.

Kann bitte jemand helfen.

<ScrollView 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:background="@drawable/border"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".EditEntry" >
    <TableLayout
        android:id="@+id/tableLayout1"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <TableRow
            android:id="@+id/tr3a"
            android:padding="2.5dp"
            android:background="@color/col1"
            android:gravity="center_vertical"
            android:layout_width="wrap_content"
            android:layout_height="0dp"
        android:layout_weight="1" >

            <TextView
                android:id="@+id/lab_bookname"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/bookname" />

            <EditText
                android:id="@+id/bookname"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:hint="@string/definputtext2" />

        </TableRow>

        <TableRow
            android:id="@+id/tr3"
            android:padding="2.5dp"
            android:background="@color/col2"
            android:gravity="center_vertical"
            android:layout_width="wrap_content"
            android:layout_height="0dp"
        android:layout_weight="1" >
            <TextView
                android:id="@+id/lab_printname"
            android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/print_name" />

            <EditText
                android:id="@+id/printname"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:hint="@string/definputtext2" />

        </TableRow>
        ......................
        ......................
        ......................
    </TableLayout>
</ScrollView>

Android TableLayout innen ScrollView

Versuchen Sie, um die Höhe des scrollview zu fill_parent android:layout_height="fill_parent"
keine Auswirkungen, Gleiches Ergebnis
werden Sie Ihr problem lösen?

InformationsquelleAutor abdfahim | 2013-11-28

Schreibe einen Kommentar