ScrollView
垂直:ScrollView
横向:HorizontalScrollView
ScrollView外层搭配RelativeLayout更灵活:
让ScrollView能Height=“match_parent”同时,above底部布局从而不会覆盖底部
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".ui.activity.ClockActivity"> <include android:id="@+id/top" layout="@layout/layout_clock_top"/> <RelativeLayout android:layout_below="@+id/top" android:layout_width="match_parent" android:layout_height="match_parent"> <ScrollView android:layout_above="@+id/fl" android:layout_width="match_parent" android:layout_height="match_parent"> <com.yanzhenjie.recyclerview.SwipeRecyclerView android:layout_above="@+id/fl" android:id="@+id/srv" android:layout_width="match_parent" android:layout_height="match_parent"/> </ScrollView> <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/fl" android:background="@color/ad_background_color" android:minHeight="185dp" android:layout_alignParentBottom="true"/> </RelativeLayout> </RelativeLayout>
上面布局意思是对的,但是理解有点问题,让RecyclerView直接above fragment也是能够不覆盖底部的
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
2021-08-31 Android——Glide的使用和Glide缓存问题
2021-08-31 JavaWeb——Idea文件保存路径
2021-08-31 JavaWeb——DiskFileItemFactory