如何在Xamarin中实现InfoWindowAdapter接口? [英] How do I implement an InfoWindowAdapter interface in Xamarin?

查看:229
本文介绍了如何在Xamarin中实现InfoWindowAdapter接口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Xamarin而我想创建一个实现GoogleMap.InfoWindowAdapter界面的CustomWindowAdapter。

I am using Xamarin and I am wanting to create a CustomWindowAdapter that implements a GoogleMap.InfoWindowAdapter interface.

到目前为止我已尝试过这个:

I have tried this so far:

public class CustomWindowAdapter : InfoWindowAdapter
{

}

我收到此错误:


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

Error CS0246: The type or namespace name 'InfoWindowAdapter' could not be found (are you missing a using directive or an assembly reference?)

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

我可以请有一些帮助吗?

Can I please have some help?

我需要使用哪种使用声明?

What using statement do I need to use?

提前致谢

推荐答案

第1步:从Component Store获取Google Play服务组件

Step 1: Get Google Play Services component from Component Store

第2步:实施GoogleMap.IInfoWindowAdapter

Step 2: Implement 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
}

这篇关于如何在Xamarin中实现InfoWindowAdapter接口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆