Я пытаюсь поместить изображение для нижней части моей страницы. Я попытался установить его с помощью android: gravity = "bottom", но мое изображение не выровнялось в нижней части страницы.Как положить изображение внизу страницы
Вот мой XML,
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ProgressBar
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleLarge"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/login_land_layout_margin"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/logo"
android:src="@drawable/ic_logo" />
<EditText
android:id="@+id/codeEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:ems="10"
android:hint="@string/code"
android:textColorHint="#FFFFFF"
android:inputType="textPassword" >
<requestFocus />
</EditText>
<EditText
android:id="@+id/nameEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:ems="10"
android:hint="@string/name"
android:textColorHint="#FFFFFF"
android:inputType="textPersonName" />
<EditText
android:id="@+id/emailEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:ems="10"
android:hint="@string/email"
android:textColorHint="#FFFFFF"
android:inputType="textEmailAddress" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/login_land_margin_both"
android:layout_marginRight="@dimen/login_land_margin_both"
android:orientation="vertical" >
<Button
android:id="@+id/loginBtn"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/login_Land_margin_top"
android:background="#0f4b9b"
android:text="@string/login"
android:textColor="@color/LoginButtonColor" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >
<ImageView
android:id="@+id/poweredBy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/poweredby"
android:gravity="bottom"
android:scaleType="fitXY"
/>
</LinearLayout>
</RelativeLayout>
Вот вид моего образа.
Мне нужно добавить питание от изображения на нижней части страницы.
На вашем экране ScrollView измените высоту, чтобы заполнить родительский андроид: layout_height = "fill_parent" –
Простое использование выровняйте родительское дно в своем макете, в котором вы разместили изображение ... вы можете использовать его непосредственно в изображении. линейный макет –
yup like Neha сказал, что вы можете использовать выравнивание родительского дна, я думаю, что вам проще использовать RelativeLayout, если вы просто сделаете макет со страницей входа в систему – RichFounders