Search code examples
androidandroid-webviewfade

WebView fading edge is a solid block


I am trying to get fading edges working for Android 4.1. I've figured out I need "android:requiresFadingEdge", but now instead of a fade, I get a solid block that appears on the top/bottom when I'm scrolling.

<WebView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:fadingEdge="vertical"
    android:fadingEdgeLength="20dp"
    android:overScrollMode="never"
    android:requiresFadingEdge="vertical" />

Has anyone seen this before?


Solution

  • Got same problem on Android 4.0.3

    Solution for me: Disable hardware acceleration for WebView:

    if (Build.VERSION.SDK_INT >= 11) {
        webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
    }