0

我有以下问题:

我在 Xamarin 表单中有一个主详细信息页面,在它上面我有一个由 Xamarin droid 中的自定义渲染器渲染的地图。地图很好用,在这里没有问题。我的代码 100% 等于:

当我使用这个时:

NativeMap.MyLocationEnabled = true;

位置按钮出现,当我单击它时,相机会移动到我的位置,没关系,但是单击时此按钮不会变为蓝色(保持灰色),然后地图在更改位置时不会跟随用户。

这是我的代码:

public void OnMapReady(GoogleMap googleMap)
{
    NativeMap = googleMap;
    NativeMap.MyLocationEnabled = true;
    //NativeMap.InfoWindowClick += OnInfoWindowClick;
    NativeMap.SetInfoWindowAdapter(this);
    NativeMap.UiSettings.ZoomControlsEnabled = Map.HasZoomEnabled;
    NativeMap.UiSettings.ZoomGesturesEnabled = Map.HasZoomEnabled;
    NativeMap.UiSettings.ScrollGesturesEnabled = Map.HasScrollEnabled;
}

有没有办法启用此功能或必须手动执行?

非常感谢大家!

4

0 回答 0