java Android滚动视图去除蓝光

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14200046/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 15:26:42  来源:igfitidea点击:

Android scrollview remove blue light

javaandroidxmlandroid-layout

提问by Nagi

When you scroll on Android using scrollview, it generates a blue light the direction you are scrolling in. How would I remove the blue light?

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

My manifest:

我的清单:

<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 source code:

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);

}
  }

回答by bricklore

Try adding this to your ScrollView in your layout.xml:

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

android:overScrollMode="never"  

or add this to your code:

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

findViewById(R.id.sobreScrollView).setOverScrollMode(ScrollView.OVER_SCROLL_NEV??ER);

回答by nmw

Add this extra line to your ScrollViewdefinition:

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

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/sobreScrollView"
    ...
    android:overScrollMode="never">