【问题标题】:Is it possible to use clipToPadding in a ViewGroup for only the top padding?是否可以在 ViewGroup 中使用 clipToPadding 仅用于顶部填充?
【发布时间】:2021-08-03 15:26:54
【问题描述】:
所以基本上我有一个聊天回收器视图。有时聊天顶部会显示一些底部筹码,现在我想要的是从顶部淡出聊天但在底部显示聊天项目(甚至在筹码后面)。基本上我想要的是将cliptopadding 应用到顶部作为true 以在回收器视图中使用fadeEdge 并使用cliptopadding false 作为底部填充?有可能吗?
【问题讨论】:
标签:
android
android-studio
android-layout
android-recyclerview
android-paging
【解决方案1】:
是的,您可以像这样提供填充(左、右、上、下)
android:id="@+id/rec"
android:layout_width="match_parent"
android:clipToPadding="false"
android:paddingBottom="@dimen/_12sdp"
android:paddingTop="@dimen/_10sdp"
android:layout_height="match_parent" />