我的工作是使用Xamarin.Forms进行移动应用程序开发。我正在使用Xamarin WebView来渲染一些web视图内容,并且我在iOS应用程序中遇到了性能问题。因此,我分析并发现WKWebView将提高性能。
如何在Xamarin Forms WebView中使用WKWebView而不是UIWebView?有没有定制的渲染可以做到这一点?
因此,我们需要创建一个渲染地图的应用程序,目前我们正在使用Xamarin.Forms来集成它。但是,我们不会使用Xamarin.Forms.Maps,因为我们必须使用Google Maps API for iOS,而不是它的原生地图MapKit。
我的问题是,如何在Xamarin.Forms中集成这个组件?
我需要一个用于iOS渲染器的等效事件:
public class MyMapRenderer : Xamarin.Forms.Maps.Android.MapRenderer
{
...
protected override void OnMapReady(GoogleMap map)
{
base.OnMapReady(map);
// need to do things here
}
...
}
谢谢
使用自定义呈现器,可以禁用CarouselPage在iOS上的滑动手势,如下所示:
using UIKit;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
[assembly: ExportRenderer(typeof(CarouselPage), typeof(CustomCarouselPageRenderer))]
namespace App.iOS
{
public class CustomCarouselPageRenderer : CarouselPageRenderer
{
pro
我正在尝试使用自定义渲染器在我的Xamarin.Forms项目中关闭CollectionView对iOS的反弹效果。我能够在ListView中使用下面的代码来实现这一点: if (e.NewElement != null)
{
var listView = Control as UITableView;
Control.Bounces = false;
} 但CollectionView控件中的Bounces属性不可用。有没有其他方法可以做到这一点?
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
using Xamarin.Forms.Material.iOS;
using MyApp.iOS;
using MyApp;
using UIKit;
using System.ComponentModel;
[assembly: ExportRenderer(typeof(CustomMaterialEntry), typeof(CustomMaterialEntryRenderer), new[] { typeof(VisualMarker.MaterialVisual) }
我为Xamarin Forms Map实现了一个自定义渲染器来实现一个Tap事件。
在PCL中我有这样的代码:
public class ExtMap : Map
{
/// <summary>
/// Event thrown when the user taps on the map
/// </summary>
public event EventHandler<MapTapEventArgs> Tapped;
#region Constructors
如何更改Xamarin.Forms.ListView,特别是iOS的活动指示器微调器的颜色?
关于这个问题,我找到了 ,但在这一点上,自定义渲染器对我来说太高级了,我还不能真正理解它们。
使用第二个链接,我使用给定的代码在iOS项目中创建了类,并在PCL项目中创建了一个类,以便可以从我的XAML视图中引用它:
namespace spinnerTest
{
public class ColoredRefreshListView : ListView
{
}
}
为了方便起见,我找到了以下代码:
public class ColoredRefreshListViewRen
我想在我的Xamarin应用程序中更改底部TabBar的高度。现在,我通过ViewModel属性完成此操作: public partial class MainPage : TabbedPage
{
public int TabBarHeight
{
get { return _tabBarHeight; }
set { _tabBarHeight = value; OnPropertyChanged(); }
}
int _tabBarHeight = 200; 以及用于iOS的自定义渲染器: using System;
us
我正在尝试使用 Google.Maps nuget包和示例教程在我的Xamarin Forms iOS应用程序中实现Google。我已经安装了nuget包,并在我的项目的using Google.Maps部分中包含了带有iOS的包,但是当我试图覆盖Google.Maps函数时,我收到了一个错误,无法找到这些函数:
MyCoolClass.LoadView() : no suitable method found to override MyCoolClass.ViewWillAppear(bool) : no suitable method found to override
这是我的代码: