【发布时间】:2020-06-18 08:19:15
【问题描述】:
我在 My Xamarin Forms 应用程序中将 WebViewRenderer 更改为 WkWebViewRenderer。我之前有 Scrolled 方法,我覆盖它以检测滚动到结束。但是在 WkWebViewRenderer 中没有这样的方法可用。这还能如何实现?
public override void Scrolled(UIKit.UIScrollView scrollView)
{
base.Scrolled(scrollView);
float y1 = (float)scrollView.ContentOffset.Y;
if ((this.Element as CustomWebview).ScrolledToEnd == false)
{
if ((scrollView.ContentSize.Height - 20) < (y1 + this.Element.Height))
{
(this.Element as CustomWebview).ScrolledToEnd = true;
if ((this.Element as CustomWebview).ScrollToEndDelegate != null)
{
(this.Element as CustomWebview).ScrollToEndDelegate.Invoke(true);
}
}
}
}
【问题讨论】:
标签: ios xamarin xamarin.forms wkwebview