我有这个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>
当我打开我的应用程序,在谷歌提示输入任何东西,我不能在结果页面上滚动。我如何启用这一点?
当我在谷歌上搜索"xamarin webview启用滚动"时,我只找到了关于禁用它的信息...
4条答案
按热度按时间3b6akqbq1#
创建您自己的渲染器并重写此方法,如下所示:
请在此链接中查找详细信息
r9f1avp52#
enxuqcxy3#
对我来说,问题出在
<WebView/>
内部,我设置了静态的HeightRequest和WidthRequest -因为文档中说如果使用<StackLayout>
,这些是必需的-但事实并非如此删除这些并添加VerticalOptions=“FillAndExpand”和HorizontalOptions=“FillAndExpand”,为我解决了这个问题,并允许我按预期滚动。
jckbn6z74#
这对我在android中非常有效