【发布时间】:2017-10-02 10:15:09
【问题描述】:
我在另一个包含 RecyclerView 的 RelativeLayout 中包含了一个标头 RelativeLayout。我希望标题与 RecyclerView 一起滚动,也就是说,当我向下滚动 RecyclerView 时,标题会消失,只会重新出现在最顶部。
This 是 Activity 布局(包括 RecyclerView 和标题)。 This 是标头的 XML 文件。 This 是 android Activity。
【问题讨论】:
-
为什么不在
RecyclerView本身内添加标题? -
@NileshDeokar 我认为这是不可能的。单独的 header 由 ImageView、TextView 和 LinearLayout 组成。
-
会有什么不同?如果位置为 0,您需要做的就是膨胀
header_view。
标签: java android android-recyclerview onscrolllistener