简体   繁体   中英

How do I make RelativeLayout disappear when scrolling in a RecyclerView

I've included a header RelativeLayout inside another RelativeLayout that contains the RecyclerView . I want the header to scroll with the RecyclerView , that is, as I scroll down the RecyclerView, the header will disappear and will only reappear at the very top.

This is the Activity layout (which includes both the RecyclerView and the header). This is the XML file for the header. This is the android Activity .

I thing you should add header inside top of recycler view ,you can refer this link to implement header in recycler view

https://github.com/lopspower/HFRecyclerView

It's help me to add header at top of recycler view.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM