The blue shadow over scroll effect looks really ugly in our app.
Is there a way to dis开发者_运维技巧able all the over scroll effect? You know there are lots of ScrollView
s and Lists in it... That would be a shame if I have to disable it in every widget that can
scroll...
thx~
You can do it simply
In layout.XML
Set
android:overScrollMode="never"
In scrollview
You can define a ScrollViewStyle and ListViewStyle in your Theme:
<style name="Theme.MyTheme" parent="android:Theme.Holo">
<item name="android:listViewStyle">@style/Widget.MyTheme.ListView</item>
<item name="android:scrollViewStyle">@style/Widget.MyTheme.ScrollView</item>
</style>
<style name="Widget.MyTheme.ListView" parent="android:Widget.ListView">
<item name="android:overScrollMode">never</item>
</style>
<style name="Widget.MyTheme.ScrollView" parent="android:Widget.ScrollView">
<item name="android:overScrollMode">never</item>
</style>
Then you have to define your Theme in you AndroidManifest.xml
:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ch.citux.example"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:targetSdkVersion="16" android:minSdkVersion="8"/>
<application
android:hardwareAccelerated="true"
android:label="@string/app_name"
android:icon="@drawable/ic_launcher"
android:theme="@style/Theme.MyTheme">
That's it, no more overscroll ;)
I have face same problem
try this code
listView.setOverScrollMode(View.OVER_SCROLL_NEVER);
You can disable all the over scroll effects by opening "res/values/styles.xml" file and adding the item line like bellow:
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:overScrollMode">never</item>
</style>
Have you already used setOverScrollMode
, with OVER_SCROLL_NEVER
?
精彩评论