如何在 Xamarin 中实现 InfoWindowAdapter 接口?

问题描述 投票:0回答:2

我正在使用 Xamarin,我想创建一个实现 GoogleMap.InfoWindowAdapter 接口的 CustomWindowAdapter。

到目前为止我已经尝试过:

public class CustomWindowAdapter : InfoWindowAdapter
{

}

我收到此错误:

错误 CS0246:找不到类型或命名空间名称“InfoWindowAdapter”(是否缺少 using 指令或程序集引用?)

这里是该界面的文档:https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/GoogleMap.InfoWindowAdapter

我可以帮忙吗?

我需要使用什么using语句?

提前致谢

interface xamarin google-maps-android-api-2 android-adapter implements
2个回答
7
投票

第 1 步:从组件商店获取 Google Play Services 组件

第 2 步:实现 GoogleMap.IInfoWindowAdapter

using Android.Gms.Maps;
using Android.Gms.Maps.Model;
using Android.Views;

public class InfoWindow : Java.Lang.Object, GoogleMap.IInfoWindowAdapter
{
    #region IInfoWindowAdapter implementation

    public View GetInfoContents(Marker p0)
    {
        throw new NotImplementedException ();
    }

    public View GetInfoWindow(Marker p0)
    {
        throw new NotImplementedException ();
    }

    #endregion
}

0
投票

我需要对 iOS 做同样的事情, 有什么帮助吗?

谢谢 吉安路易吉

© www.soinside.com 2019 - 2024. All rights reserved.