Android TableLayout à l'intérieur de ScrollView
Je veux à la fois la ScrollView TableLayout pour avoir la même hauteur que l'écran, mais whyy table est prise seulement la moitié de l'écran, tandis que le ScrollView prend plein écran comme prévu.
J'ai essayé de changer la hauteur de la table et de lignes que wrap_content, mais montrant même résultat. Aussi l'évolution de la hauteur de la table en tant que hauteur fixe (par exemple, 900dp) ne fonctionne pas aussi bien. Même le dernier de la hauteur de la ligne ne s'affiche pas complète cote de bar. Semble que le tableau est obligé d'avoir cette largeur.
Si je supprime le ScrollView, il fonctionne très bien.
Quelqu'un peut s'il vous plaît aider.
<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>
- Essayez de prendre de la hauteur à la scrollview à
fill_parent
android:layout_height="fill_parent"
- aucun impact, même résultat
- êtes-vous de réparer votre problème?
Vous devez vous connecter pour publier un commentaire.
ajouter cette ligne dans votre scrollview xml -->
Cela permet à l'enfant de mise en page pour prendre en plein écran si c'est layout_width & layout_height est match_parent/fill_parent. . Dans votre cas TableLayout obtiendrez la taille complète sur l'utilisation de cette ligne ..! enjoy...!
Mettre un linearlayout entre les deux œuvres, mais je ne sais pas pourquoi certaine hauteur de vue de table directement ne fonctionne pas.