---
title: "去掉listview顶部和底部阴影(高光部分)"
author: "zyzzsky"
date: "2013-11-13T11:04:09Z"
tags: []
categories: ["非技术"]
slug: "listview"
draft: false
lastmod: "2013-11-13T11:04:09Z"
id: 1964784
url: "https://zyzzsky.iteye.com/blog/1964784"
---

```
/**
	 * 去掉listview顶部和底部阴影(高光部分)
	 * 
	 * @param view
	 */
	public static void disableOverScrollMode(View view) {
		if (Build.VERSION.SDK_INT < 9) {
			return;
		}
		try {
			Method m = View.class.getMethod("setOverScrollMode",
					new Class[] { Integer.TYPE });
			m.setAccessible(true);
			m.invoke(view, new Object[] { Integer.valueOf(2) });
		} catch (Throwable t) {
			t.printStackTrace();
		}
	}
```