Webview 无法滚动

编程入门 行业动态 更新时间:2024-10-24 04:42:40
本文介绍了Webview 无法滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我有这个 Xamarin 表单页面:

I've got this Xamarin Forms page:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft/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>

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

When I open my app, enter anything in the google prompt, I can't scroll on the results page. How do I enable this?

当我在谷歌搜索xamarin webview 启用滚动"时,我只找到有关禁用它的信息...

When I google for "xamarin webview enable scrolling" I only find information about disabling it...

推荐答案

创建自己的渲染器并按如下方式覆盖此方法:

Create your own renderer and override this method as follows:

public override bool DispatchTouchEvent(MotionEvent e)
{
    Parent.RequestDisallowInterceptTouchEvent(true);
    return base.DispatchTouchEvent(e);
}

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

这篇关于Webview 无法滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-26 04:33:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1129016.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Webview

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!