In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
How to realize the head suspension control based on RecycleView in Android development. In order to solve this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
RecyclerView is a sliding list similar to ListView, but compared with ListView, RecyclerView is better than ListView, RecyclerView supports horizontal sliding, RecyclerView has no click events, needs to join itself, and can make all kinds of cool effects animation, which is more in line with high cohesion and low coupling.
Preface
The other day I saw a filter box in RecycleView that can be suspended in the head with an effect similar to that of the opportunity module in the opportunity box.
The original idea was very conventional.
Through the Recycview decorator to achieve (at first it is too difficult to deny) through Recycleview slide listening to determine whether the current visible item is what I need to deal with, and then through the show hidden to do a simple logical processing (but the effect is not satisfactory, while the Recycleview is flexible sliding, the distance I can not monitor, so I died. )
Through the difficult to ask for help, or through the Recycleview decorator to achieve, of course, I also stand on the shoulders of the boss, combined with their own business processing, and then sorted into a private database. Mode of use:
Dependence
The first step is the bulid.gradle of the project
Allprojects {repositories {... Maven {url 'https://jitpack.io'}
Step 2: add dependencies
Dependencies {implementation 'com.github.Qiaoshi96:StickyRecycleView:1.2'}
It is based on the use of RecycleView dependencies to add RecycleView dependencies first
Implementation 'com.android.support:recyclerview-v7:26.1.0'
For specific usage (Dome address), you can use GitHub:
Https://github.com/Qiaoshi96/StickyRecycleView.git
Overall Arrangement
The adapter will not be posted. You can download dome and run it.
Effect picture
I am here to click back to the top of the effect can be set according to the business.
This is the answer to the question about how to implement the head suspension control based on RecycleView in Android development. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.