gpt4 book ai didi

c# - Xamarin - WebView 下拉刷新

转载 作者:行者123 更新时间:2023-11-30 23:01:44 26 4
gpt4 key购买 nike

我在谷歌上到处搜索,似乎这个“拉动刷新”功能只适用于 ListViews。有一些关于 WebView 的“拉动刷新”的帖子,但它们是用 Java 和 Android Studio 编码的。有什么简单的方法可以实现吗?

最佳答案

您可以使用 @jamesmontemagno's PullToRefreshLayout并将您的 WebView 包含在 PullToRefreshLayout 元素中:

<?xml version="1.0" encoding="UTF-8"?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="RefreshSample.Views.ScrollViewXamlPage"
xmlns:controls="clr-namespace:Refractored.XamForms.PullToRefresh;assembly=Refractored.XamForms.PullToRefresh"
Title="Xaml Scroll">
<controls:PullToRefreshLayout
IsPullToRefreshEnabled="True"
RefreshCommand="{Binding RefreshCommand}"
IsRefreshing="{Binding IsBusy}"
RefreshColor="Blue">

<WebView>
</WebView>

</controls:PullToRefreshLayout>
</ContentPage>

关于c# - Xamarin - WebView 下拉刷新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50871112/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com