如何放置相对布局在屏幕(或线性布局)的底部? [英] How to place Relative layout at bottom of screen(or linear layout).?
本文介绍了如何放置相对布局在屏幕(或线性布局)的底部?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下的XML
我想提出的第二线布局在屏幕的底部。 我会怎么办? 我有第二个相对布局属性设置为底部,但仍没有显示在底部。
I wanna put the second linear layout at the bottom of the screen. How will i do? I have set the property of second Relative layout to bottom but still not showing at bottom..
**
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<RelativeLayout android:id="@+id/RelativeLayout01"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</RelativeLayout>
<RelativeLayout android:id="@+id/RelativeLayout02"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</RelativeLayout>
<RelativeLayout android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_gravity="bottom">
</RelativeLayout>
</LinearLayout>
** 感谢名单提前
** Thanx in advance
推荐答案
您想在底部应具备的布局:
安卓重力=底部
与其父应具备:
安卓layout_height =FILL_PARENT
The Layout you want at the bottom should have:
android:gravity = "bottom"
and its parent should have:
android:layout_height="fill_parent"
这篇关于如何放置相对布局在屏幕(或线性布局)的底部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文