Closed kabukky closed 8 years ago
Hi,
I don't think this is related to NestedScrollWebView, since it just extends the regular Android WebView.
Try setting
webView.setScrollbarFadingEnabled(true);
webView.setScrollBarStyle(WebView.SCROLLBARS_INSIDE_OVERLAY);
on your WebView.
I found a fix. It seems to be a problem with passing down the constructor arguments to NestedScrollWebView(Context context, AttributeSet attrs, int defStyleAttr)
. Calling super
instead brings back the scroll bar.
You are doing this:
public NestedScrollWebView(Context context) {
this(context, null);
}
public NestedScrollWebView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public NestedScrollWebView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
mChildHelper = new NestedScrollingChildHelper(this);
setNestedScrollingEnabled(true);
}
Here's how I fixed it:
public NestedScrollWebView(Context context) {
super(context);
mChildHelper = new NestedScrollingChildHelper(this);
setNestedScrollingEnabled(true);
}
public NestedScrollWebView(Context context, AttributeSet attrs) {
super(context, attrs);
mChildHelper = new NestedScrollingChildHelper(this);
setNestedScrollingEnabled(true);
}
public NestedScrollWebView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
mChildHelper = new NestedScrollingChildHelper(this);
setNestedScrollingEnabled(true);
}
Thanks for providing a fix.
Hi, thanks for your project. I just replaced my old vanilla WebView with NestedScrollWebView and while everything else seems fine, there is one difference: NestedScrollWebView has no scroll bar on the right side. Are you seeing this on your end too?
Thanks Kai