【发布时间】:2021-04-17 21:42:05
【问题描述】:
我已完成以下链接中显示的所有内容: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-renderer/map-pin
效果很好,显示名为 pin.png 的图像
我想保留那个,但添加另一个带有不同图像的图钉。
我应该在我的代码中添加/更改什么来做到这一点?
这是我目前用来设置图钉的方法
CustomPin pin4 = new CustomPin
{
Type = PinType.Place,
Position = new Position(9.936165, -84.039919),
Label = "Fin",
};
map.CustomPins = new List<CustomPin> { pin };
map.Pins.Add(pin4);
如何使用标记选项 seticon?
【问题讨论】:
-
到目前为止,您为实现另一个图像做了哪些工作?你遇到了什么问题?
-
我尝试创建另一个渲染器类,但遇到了很多错误,另外在 android 渲染器中我看不到 pin.png 的调用位置,在 iOS 中有这一行“annotationView.Image = UIImage.FromFile("pin.png");"
标签: c# google-maps xamarin.forms