gpt4 book ai didi

android - 如何在android中的Relativelayout内底部放置一个Linearlayout

转载 作者:太空狗 更新时间:2023-10-29 15:31:24 28 4
gpt4 key购买 nike

我需要在 relativelayout 的底部放置一个线性布局,它是 xml 中最顶层的父级。我怎样才能做到这一点?

请帮帮我。

 <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background"
android:orientation="vertical" >
<RelativeLayout ....... <<--- this should occupy total available space
</Relativelayout
<Linearlayout ....... <<-- this should place at bottom always with height 50dp
</LineaLayout>
</ReltiveLayout>

最佳答案

请试试这个:

<LinearLayout android:layout_alignParentBottom="true" android:layout_height="50dp" android:layout_width="wrap_content">
</LinearLayout>

您可以通过上述属性在 xml 中底部对齐。

关于android - 如何在android中的Relativelayout内底部放置一个Linearlayout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10861361/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com