1

嗨,我有 2 个项目进入线性布局,我需要将它们推到屏幕底部。现在他们也从屏幕开始。我该怎么做?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical">


<ImageView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:adjustViewBounds="true"
    android:layout_gravity="bottom"
    android:gravity="bottom"
    android:src="@drawable/splash" />

<include
    android:layout_gravity="bottom"
    android:id="@+id/footer_raw"
    android:layout_width="fill_parent"
    android:gravity="bottom"
    android:layout_height="30dp"
    layout="@layout/footer_raw" />
</LinearLayout>
4

4 回答 4

2

替换LinearLayoutRelativeLayoutandroid:layout_alignParentBottom你的“真”footer_raw

于 2013-11-13T12:31:01.720 回答
0

将此属性应用于您的项目,
android:layout_gravity="bottom"。或使用相对布局作为您的父布局。

于 2013-11-13T12:37:32.057 回答
0

添加android:layout_gravity="bottom"到您的父布局。

于 2013-11-13T12:30:06.750 回答
0

将您的代码更改为此

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="bottom"
android:orientation="vertical">


<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:layout_gravity="bottom"
android:gravity="bottom"
android:src="@drawable/splash" />

<include
android:layout_gravity="bottom"
android:id="@+id/footer_raw"
android:layout_width="fill_parent"
android:gravity="bottom"
android:layout_height="30dp"
layout="@layout/footer_raw" />
</LinearLayout>
于 2013-11-13T12:32:14.260 回答