Remove a blue or yellow shadow from the top and bottom of the ListView

Source: Internet
Author: User

By default, a yellow or blue shadow appears when the ListView is sliding to the top or bottom. The methods that are resolved on different versions can be resolved by setting android:fadingedge= "None" in the properties of the ListView before the 2.3 release, but in the 2.3 and later versions this method is invalid, and here, you can override the The ListView uses code to set the pattern to prevent its shadows from appearing, so as not to affect aesthetics. The code is as follows:

 PackageCom.sunzn.cview;ImportAndroid.content.Context;ImportAndroid.os.Build;ImportAndroid.util.AttributeSet;ImportAndroid.view.View;ImportAndroid.widget.ListView; Public  class customlistview extends ListView {     Public Customlistview(Context context) {Super(context); } Public Customlistview(context context, AttributeSet attrs) {Super(context, attrs);if(Integer.parseint (Build.VERSION.SDK) >=9) { This. Setoverscrollmode (View.over_scroll_never); }    }}

Another simpler way to add directly to the XML file:

android:overScrollMode="never"

Reference article: http://www.cnblogs.com/sunzn/p/3487509.html

Remove a blue or yellow shadow from the top and bottom of the ListView

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.