28

当您使用滚动视图在 Android 上滚动时,它会在您滚动的方向上生成蓝光。如何移除蓝光?

我的清单:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/sobreScrollView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:cacheColorHint="@android:color/transparent"
android:scrollingCache="false" 
android:fadingEdge="none"
android:fadingEdgeLength="0dp"
android:scrollbars="none"
android:scrollbarStyle="insideOverlay"  
    >    

    <LinearLayout
        android:id="@+id/contentSobre"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >

Java源代码:

package com.my.app.section;
import android.content.Context;
import android.util.AttributeSet; 
import com.my.app.BaseSection; 
import com.my.app.R;

public class SobreSection extends BaseSection {

public SobreSection(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
}

public SobreSection(Context context, AttributeSet attrs) {
    super(context, attrs);
}

public SobreSection(Context context) {
    super(context);
}

@Override
protected void onFinishInflate() {
    // TODO Auto-generated method stub
    super.onFinishInflate();

    findViewById(R.id.sobreScrollView).setVerticalFadingEdgeEnabled(false);
    findViewById(R.id.sobreScrollView).setVerticalScrollBarEnabled(false);

}
  }
4

2 回答 2

89

尝试将此添加到您的 layout.xml 中的 ScrollView:

android:overScrollMode="never"  

或将此添加到您的代码中:

findViewById(R.id.sobreScrollView).setOverScrollMode(ScrollView.OVER_SCROLL_NEV‌​ER);
于 2013-01-07T16:44:35.587 回答
11

将此额外的行添加到您的ScrollView定义中:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/sobreScrollView"
    ...
    android:overScrollMode="never"> 
于 2013-01-07T17:08:54.737 回答