J'ai la disposition que je veux organiser. Voici le code de ce: (partiel)Comment forcer la disposition androïde pour afficher deux vues
<RelativeLayout
android:id="@+id/RelativeLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true" >
<TableLayout
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#d9d9d9"
android:clickable="true"
android:stretchColumns="*" >
</TableLayout>
</ScrollView>
<LinearLayout
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="@+id/scrollView1"
android:background="@android:color/background_light"
android:orientation="vertical" >
<TextView
android:id="@+id/showingXoutOfY"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/XOutOfY"
android:textColor="@color/blue" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/copyright"
android:textColor="@android:color/black" />
</LinearLayout>
</RelativeLayout>
Je veux que le ScrollView
pour remplir l'écran, mais je veux à laisser un espace pour le LinearLayout
avec le TextViews
dans le fond. Comme vous pouvez le voir j'ai essayé de les emballer à l'intérieur d'un RelativeLayout
et j'ai aligné le ScrollView
vers le haut et le LinearLayout
vers le bas, mais il montre toujours seulement le ScrollView
. Le TableLayout
qui est imbriqué dans le ScrollView
est rempli dynamiquement.
Vous voulez donc afficher scrollview au-dessus de TextView à l'intérieur de LinearLayout. N'est-ce pas? –
@ shree202 Oui. Le conteneur n'a pas d'importance. Peut-être que ce sera plus clair si je dis ce que je veux faire. TableLayout est une liste d'éléments. le TextView contient des informations sur combien d'éléments il y a dans la liste –
essayez de définir la hauteur de scrollview comme contenu d'habillage –