【发布时间】:2016-10-23 14:45:01
【问题描述】:
我有这个 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>
当我打开我的应用程序时,在 google 提示符中输入任何内容时,我无法在结果页面上滚动。如何启用此功能?
当我在谷歌上搜索“xamarin webview 启用滚动”时,我只能找到有关禁用它的信息...
【问题讨论】:
-
考虑到高度请求确实认为WebView高到不需要滚动?
-
你在什么平台上测试?
-
发现和stacklayout有关。如果我在 stacklayout 中没有 webview,它滚动得很好。但后来我问自己,我如何对齐表单上的任何其他控件,以使用户能够访问选项或类似的东西,同时仍然让 webview 占用其余空间。
-
我在 Windows Phone 10 上测试
-
在 Android 上它适用于堆栈布局。我可以尝试在 Windows phone 8 上进行测试。它适用于你的 phone 8 吗?您能否在此页面上提供您想要实现的图像?顺便提一句。在 Android 上设置宽度和高度请求似乎没有任何效果。我认为你应该使用 HorizontalOptions 和 VerticalOptions