Comment définir le contenu dans un Linéaire de la mise en page vers le BAS de l'Écran sous Android.?
Voir le code XML suivant
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<include layout="@layout/header" />
<TextView
android:layout_width="fill_parent"
android:layout_height="18dp" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/header"
android:orientation="horizontal" >
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/calendar" />
<TextView
android:id="@+id/tvTitle"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:gravity="center"
android:text="@string/calendar"
android:textColor="#FFFFFFFF"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/myLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
</LinearLayout>
<!-- <include layout="@layout/footer"/> -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@drawable/datename_bottom_bg"
android:orientation="horizontal">
<TextView
android:id="@+id/upgrade_4"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_weight="1"
android:drawableTop="@drawable/upgrade"
android:gravity="center"
android:text="@string/upgrade"
android:textSize="8sp" />
<TextView
android:id="@+id/panchang_4"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_weight="1"
android:drawableTop="@drawable/kalash_bottom"
android:gravity="center"
android:text="@string/panchang"
android:textSize="8sp" />
<TextView
android:id="@+id/time_range_4"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_weight="1"
android:drawableTop="@drawable/timer_bottom"
android:gravity="center"
android:text="@string/timespan"
android:textSize="8sp" />
<TextView
android:id="@+id/reminder_4"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_weight="1"
android:drawableTop="@drawable/reminder_bottom"
android:gravity="center"
android:text="@string/reminders"
android:textSize="8sp" />
<!--
<TextView android:id="@+id/calendar_4" android:layout_width="50dp" android:layout_height="50dp" android:drawableTop="@drawable/calendar_bottom"
android:text="@string/calendar" android:textSize="8sp" android:gravity="center" android:layout_weight="1"/>
-->
</LinearLayout >
</LinearLayout>
</ScrollView>
Ce que cela ressemble est sur la gauche et que je veux qu'elle ressemble est sur la droite, j'ai aussi essayé en remplaçant LinearLayout à RelativeLaout mais toujours pas de travail. S'Il Vous Plaît Aider.!
Utiliser un
vous pouvez utiliser une relative mise en page et la mettre au fond
Si la ScrollView est plus grande que l'écran, voulez-vous le LinearLayout pour être au bas de l'écran (image de droite) ou au bas de la ScrollView?
Je ne peux pas voir votre image. que voulez-vous, il ressemble sur la droite
Je le veux comme mon Droit à l'Image.
LinerLayout
comme l'élément racine et nest la ScrollView
(en plus d'une LinearLayout
). Imbriquez vos pied de page en dehors de la ScrollView
. Cela devrait le faire.vous pouvez utiliser une relative mise en page et la mettre au fond
Si la ScrollView est plus grande que l'écran, voulez-vous le LinearLayout pour être au bas de l'écran (image de droite) ou au bas de la ScrollView?
Je ne peux pas voir votre image. que voulez-vous, il ressemble sur la droite
Je le veux comme mon Droit à l'Image.
OriginalL'auteur Dnyanesh M | 2013-07-19
Vous devez vous connecter pour publier un commentaire.
Vous devez utiliser RelativeLayout, Regardez par exemple
Cela vous donnera quelque chose de similaire. Il suffit de placer vos widgets à la place de mes boutons.
OriginalL'auteur Viacheslav
pourquoi ne pas vous suffit d'utiliser
relative layout
en tant que parent de mise en page de définir la vue commealignparentbottom= true
.alors si vraiment besoin, vous pouvez mettre unlinear layout
dans le reste de l'espaceessayez parent hauteur de présentation comme matchparent pas wrapcontent...
OriginalL'auteur shreyas
Essayer relative de la mise en page à l'intérieur de laquelle vous pouvez ajouter linéaire de la mise en page.
OriginalL'auteur Bharath Karnam
Vous pouvez inclure votre
LinearLayout
dans unFrameLayout
et sélectionnez dans votreLinearLayout
l'attributandroid:layout_gravity="bottom"
:OriginalL'auteur amatellanes
ensemble de la gravité:en bas à LinearLayout:
OriginalL'auteur Shani Goriwal