网页视图无法滚动

Rav*_*ior 6 webview xamarin

我有这个 Xamarin 表单页面:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:TestApp1"
             x:Class="TestApp1.MainPage">
<ContentPage.Content>
  <StackLayout Orientation="Vertical">
    <WebView Source="http://www.google.de" HeightRequest="3000" WidthRequest="100"/>
  </StackLayout>
</ContentPage.Content>
</ContentPage>
Run Code Online (Sandbox Code Playgroud)

当我打开应用程序时,在谷歌提示中输入任何内容,我无法在结果页面上滚动。我如何启用此功能?

当我搜索“xamarin webview启用滚动”时,我只找到有关禁用它的信息......

Ash*_*shi 6

创建您自己的渲染器并重写此方法,如下所示:

public override bool DispatchTouchEvent(MotionEvent e)
{
    Parent.RequestDisallowInterceptTouchEvent(true);
    return base.DispatchTouchEvent(e);
}
Run Code Online (Sandbox Code Playgroud)

请在此链接中查找详细信息