Hello,
Welcome to Microsoft Q&A!
Do you simply want to disable the webview scrolling ? If so you can do it with custom renderer in each platform.
iOS
[assembly: ExportRenderer(typeof(WebView), typeof(MyRenderer))]
namespace FormsA.iOS
{
public class MyRenderer : WkWebViewRenderer
{
protected override void OnElementChanged(VisualElementChangedEventArgs e)
{
base.OnElementChanged(e);
this.ScrollView.ScrollEnabled = false;
}
}
}
Android
[assembly: ExportRenderer(typeof(WebView), typeof(MyRenderer))]
namespace FormsA.Droid
{
class MyWebview : WebView
{
public MyWebview(Context context):base(context)
{
}
public MyWebview(Context context, IAttributeSet att ) : base(context,att)
{
}
public MyWebview(Context context, IAttributeSet att,int defStyle) : base(context,att,defStyle)
{
}
protected override void OnScrollChanged(int l, int t, int oldl, int oldt)
{
base.OnScrollChanged(l, t, oldl, oldt);
ScrollTo(l, 0);
}
}
class MyRenderer : WebViewRenderer
{
Context _context;
public MyRenderer(Context context):base(context)
{
_context = context;
}
protected override Android.Webkit.WebView CreateNativeControl()
{
return new MyWebview(_context);
}
}
}
Best Regards,
Cole Xia
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.