繁体   English   中英

Android scrollview删除蓝灯

[英]Android scrollview remove blue light

当您使用scrollview在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);

}
  }

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

android:overScrollMode="never"  

或者将其添加到您的代码中:

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

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM