我正在使用自定义Webview来解决ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs.和解析。
我的守则:
MyWebView.cs
using Xamarin.Forms;
namespace CustomWebview
{
public class MyWebView : WebView
{
public static readonly BindableProperty UrlProperty =
我已经在我的WebView项目中为一个Xamarin.Forms创建了一个自定义呈现器。WebView在安卓系统上运行得很好。不幸的是,在iOS上,当设备被旋转时,网页(任何网页)不能正确地调整以适应WebView的新维度。如果我对表单使用内置的WebView,页面在旋转时就会正确地调整大小。
我的定制渲染器怎么了?
下面是我的自定义呈现器的简化版本(问题仍在发生):
using Xamarin.Forms.Platform.iOS;
using Xamarin.Forms;
using UIKit;
using Foundation;
[assembly: ExportRenderer(t
我在我的程序集中嵌入了site:
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
WebView.Navigating += WebView_Navigating;
var resourceName = Program.GetResourceName("index.html");
WebView.Source
我的工作是使用Xamarin.Forms进行移动应用程序开发。我正在使用Xamarin WebView来渲染一些web视图内容,并且我在iOS应用程序中遇到了性能问题。因此,我分析并发现WKWebView将提高性能。
如何在Xamarin Forms WebView中使用WKWebView而不是UIWebView?有没有定制的渲染可以做到这一点?
我正在尝试使用Xamarin为我的一个项目构建一个webview应用程序,但我似乎想不出如何让webview元素转到前一个页面,而不是关闭应用程序。
所以我已经想出了如何检测后退按钮并防止它关闭应用程序,但我想让网页返回,如果网页不能返回,就关闭应用程序。
下面是我目前的代码:
using System;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using Application = Xamarin.Forms.Application;
namespace myNewApp
{
[XamlCompilation(XamlCo
我是xaml的新手,我有一个问题。我正在尝试在xamarin.forms中创建一个在我的文本旁边带有图标的按钮。但当我试图显示它时,我的应用程序上什么也没有。要添加png图标,请执行以下操作。该图像位于Ressources->drawable文件夹中。这是xaml代码。 <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x
我在Xamarin Forms android项目中使用了一个自定义WebViewRenderer,如下所示:
[assembly: ExportRenderer(typeof(Xamarin.Forms.WebView), typeof(HybridWebViewRenderer))]
namespace ClotureSiadForms.Droid.Renderer
{
internal class HybridWebViewRenderer : WebViewRenderer
{
public HybridWebViewRenderer(Context c
我们正在尝试为WebView创建一个自定义呈现程序。唯一的问题是Xamarin找不到Android.Webkit.WebView。
using [AppName];
using [AppName].Droid;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
using Mono;
using Android.Webkit;
[assembly: ExportRenderer(typeof(HybridWebView), typeof(HybridWebViewRenderer))]
namespace [
这是渲染脚本
using Android.Webkit;
using CustomRenderer;
using CustomRenderer.Droid;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
[assembly: ExportRenderer (typeof(HybridWebView), typeof(HybridWebViewRenderer))]
namespace CustomRenderer.Droid
{
public class HybridWebViewRenderer : ViewR
当按下后退按钮(OnBackPressed)时,我试图执行一些javascript(webview Eval),但是应用程序崩溃了。有人能弄清楚发生了什么吗?
MainActivity.cs
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
protected override void OnCreate(Bundle savedInstanceState)
{
/*
some code
*/
b