【发布时间】:2014-01-08 07:12:29
【问题描述】:
我正在使用 Xamarin 并且正在使用 SimpleMapDemo,我有一个关于将 MarkerOptions 对象设置为具有不同图标的问题。
这是我当前的代码:
marker1.Icon(SetFeatureDrawable('Icon.png'));
上面的代码不起作用。
能否请我帮忙将图标设置为 Drawable 文件夹中名称为“Icon.png”的图标?
提前致谢
编辑
这是我的代码:
marker1.Icon(BitmapDescriptorFactory.FromResource(Resource.Drawable.monkey));
这是我得到的错误:
Non-invocable member 'Android.Gms.Maps.Model.MarkerOptions.Icon' cannot be used like a method
这是我尝试设置图标的代码:
marker1.Icon = BitmapDescriptorFactory.FromResource(Resource.Drawable.monkey);
这是我得到的错误:
CS0200: Property or indexer 'Android.Gms.Maps.Model.MarkerOptions.Icon' cannot be assigned to -- it is read only (CS0200)
【问题讨论】:
标签: android xamarin google-maps-markers drawable google-maps-android-api-2