How to remove the shadow effect and the RecyclerView Halo when sliding controls such as recyclerview to the edge

Source: Internet
Author: User

How to remove the shadow effect and the RecyclerView Halo when sliding controls such as recyclerview to the edge

By default, slide controls such as RecyclerView have scroll bars and shadow effects when sliding to the edge. How can we remove these two default attributes? Here is a brief introduction.

Scroll bar Effect
1. Set Through xml file
Android: scrollbars = "" has three attributes.
A. none: remove the scroll bar.
B. horizontal: sets the horizontal scroll bar.
C. vertical: Set the vertical scroll bar.
2. Set Through java code
A. RecyclerView. setHorizontalScrollBarEnabled (boolean horizontalScrollBarEnabled );
B. RecyclerView. setVerticalScrollBarEnabled (boolean verticalScrollBarEnabled );
If it is set to true, a corresponding scroll bar is displayed. If it is set to false, no corresponding scroll bar is rolled to the halo of the edge.
1. Set Through xml file
Android: overScrollMode = "" has three attributes.
A. none: remove the halo effect.
B. always: always set the halo effect.
C. ifContentScrolls: set this mode. If the content in the recycleview can slide, an arc Halo will appear when sliding to the boundary. If the content in the recycleview cannot slide, then, after sliding to the boundary, the arc Halo will not appear.
2. Set Through java code
A. RecyclerView. setOverScrollMode (View. OVER_SCROLL_NEVER) is set to none in the same xml format.
B. RecyclerView. setOverScrollMode (View. OVER_SCROLL_ALWAYS) is set to always in the same xml format.
C. RecyclerView. setOverScrollMode (View. OVER_SCROLL_IF_CONTENT_SCROLLS) Complete xml code that is set to ifContentScrolls while removing the scroll bar and default halo effects.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.