ScrollView nur auf einen Teil des Bildschirms in Android

Ich habe einen Schirm mit zwei teilen. Ich möchte die oben statisch zu sein und der untere mit einem TableLayout zu sein Scrollbar. Ich habe versucht, das hinzufügen einer ScrollView an den unteren Teil des Bildschirms, aber wenn dabei das TableLayout scrollbaren der Obere Teil verschwindet.

Wie kann ich die kombinieren Sie das top statischen Teil mit einer scrollbaren unteren Teil?

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:id="@+id/LinearLayout01"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_weight="9" 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/title_shape">  
    <Button 
        android:id="@+id/btnBack" 
        android:text="@string/titleCreateTest"
        style="@style/Bar_buttonBack">
    </Button>
    <TextView android:layout_weight="6" 
        android:id="@+id/titleFlashcard" 
        android:text="@string/titleStatistic" 
        style="@style/TitleStyle">
    </TextView> 
</LinearLayout>
 <ScrollView
  android:id="@+id/ScrollView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:id="@+id/LinearLayout2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">
<TableLayout 
    android:id="@+id/table_layout"
    style="@style/TableLayoutStyle">
 <TableRow 
     android:id="@+id/table_row1">
    <TextView
            android:id="@+id/tv1"
            android:text="@string/tvRecord" 
            style="@style/TableRowStyle"/>
    <TextView
            android:id="@+id/tv1v"
            style="@style/TableRowStyleColumn2"/>
  </TableRow>
  <View
    style="@style/TableRowSeparator"/>
     <TableRow
     android:id="@+id/table_row2">
        <TextView
            android:id="@+id/tv2"
            android:text="@string/tvMedium" 
            style="@style/TableRowStyle"/>
        <TextView
            android:id="@+id/tv2v"
            style="@style/TableRowStyleColumn2"/>
    </TableRow>
      <View
    style="@style/TableRowSeparator"/>
    <TableRow
    android:id="@+id/table_row3">
        <TextView
            android:id="@+id/tv3"
            android:text="@string/tvWorst" 
            style="@style/TableRowStyle"/>
        <TextView
            android:id="@+id/tv3v"
            style="@style/TableRowStyleColumn2"/>
    </TableRow>
    </TableLayout> 
   <TableLayout 
    android:id="@+id/table_layout2"
    style="@style/TableLayoutStyle">
        <TableRow
          android:id="@+id/table_row4">
          <TextView
            android:id="@+id/tvDate"
            style="@style/TableRowStyle"/>
            <TextView
            android:id="@+id/tvResult"
            style="@style/TableRowStyleColumn2"/>
     </TableRow>
    <View
    android:id="@+id/rowseparator"
    style="@style/TableRowSeparator"/>
</TableLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
  • Es sollte einfach sein. Posten Sie Ihre layout-XML.
  • Ich habe versucht meine xml-layout, aber es nicht in die ganze Sache. Sollte ich die anderen, dass die code Klammern {} für xml?
  • Sie müssen wählen Sie alle Zeilen xml-code, und drücken Sie dann die {} - Taste, es fügt 4 Leerzeichen am Anfang jeder Zeile (das ist, was macht die Linien oder Blöcke von code formatiert).
  • Ok! Jetzt ist er da!
InformationsquelleAutor kakka47 | 2011-02-22
Schreibe einen Kommentar