作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我仍在学习 android,我正在使用此 recommendation 创建一个混合应用程序。一切正常,但是当我下载完文件后我无法返回,我正在尝试使用 copyBackForwardList 方法,但我不确定如何将 Xamarin.Forms.WebView 转换为 Android.Webkit.WebView 以使用 CopyBackForwardList 并使用其他 recommendation
我正在尝试这样的事情
protected override bool OnBackButtonPressed()
{
base.OnBackButtonPressed();
String historyUrl = "";
int i = 0;
WebBackForwardList mWebBackForwardList = (Android.Webkit.WebView)browser;
if (mWebBackForwardList.getCurrentIndex() > 0)
{
while (i < mWebBackForwardList.getCurrentIndex())
{
historyUrl = mWebBackForwardList.getItemAtIndex(mWebBackForwardList.getCurrentIndex() - ++i).getUrl();
if (historyUrl != null)
{
browser.Source = historyUrl;
Content = browser;
}
}
}
return true;
}
最佳答案
如果您想访问 native 控件,可以通过自定义渲染器来完成 https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-renderer/
关于c# - CustomWebViewRenderer DownloadManager 与 CopyBackForwardList 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59107967/
我仍在学习 android,我正在使用此 recommendation 创建一个混合应用程序。一切正常,但是当我下载完文件后我无法返回,我正在尝试使用 copyBackForwardList 方法,但
我是一名优秀的程序员,十分优秀!