gpt4 book ai didi

android - 修复了android布局中的页脚

转载 作者:行者123 更新时间:2023-11-29 17:14:30 24 4
gpt4 key购买 nike

这是我的固定页脚布局。包含 RecyclerViewFragment 附加到 FrameLayout。但是 RecyclerView 的内容被页脚布局覆盖了。

<RelativeLayout 
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical">

<FrameLayout
android:id="@+id/home_parent_framelayout"
android:layout_height="wrap_content"
android:layout_width="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />

<LinearLayout
android:id="@+id/footer_linearlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="#f1c21e"
android:layout_alignParentBottom="true">

<footer layout>

</LinearLayout>

</RelativeLayout>

最佳答案

在您的 FrameLayout 中提供属性

android:layout_above="@+id/footer_linearlayout"

它将显示 FrameLayoutFooter

这样添加:

<FrameLayout
android:id="@+id/home_parent_framelayout"
android:layout_height="wrap_content"
android:layout_width="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:layout_above="@+id/footer_linearlayout" />

解释:

你的 LinearLayout 不显示 Bottom 每当你创建 fix Footer 你的父级 Child Layout 你必须给 layout_above 属性到 Fix Footer 的高度意味着在你的情况下 LinearLayout。高度以便在屏幕中显示 LinearLayout 父子 FrameLayout 你必须给 android:layout_above="@+id/linearLayout..

关于android - 修复了android布局中的页脚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39609000/

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