C# 单击pin/标记时在地图上添加按钮(xamarin表单)
当我点击pin时,我需要在地图上添加一个按钮。我在iOS和Android上使用xamarin表单和谷歌地图 这是我的XAML:C# 单击pin/标记时在地图上添加按钮(xamarin表单),c#,google-maps,xamarin,xamarin.forms,google-maps-markers,C#,Google Maps,Xamarin,Xamarin.forms,Google Maps Markers,当我点击pin时,我需要在地图上添加一个按钮。我在iOS和Android上使用xamarin表单和谷歌地图 这是我的XAML: <AbsoluteLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"> <ContentView Content="{Binding Map}" VerticalOptions="FillAndExpand" HorizontalOption
<AbsoluteLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<ContentView Content="{Binding Map}" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" AbsoluteLayout.LayoutBounds = "1, 1, 1, 1" AbsoluteLayout.LayoutFlags = "All"/>
<Button BackgroundColor="White" IsVisible="{Binding IsPinVisible}" Text="{Binding NewAddress}" TextColor="Blue" AbsoluteLayout.LayoutBounds = "1, 0, 1, 0.15" AbsoluteLayout.LayoutFlags = "All"/>
</AbsoluteLayout>
我的Viewmodel,其中有Map.PinClicked事件:
Map.PinClicked += (sender, args) =>
{
IsPinVisible = true;
_newaddress = Address;
};
一旦我现在点击pin,就会有一个白色空白区域显示,但没有文本。当我更新LiveXaml以更改文本显示的文本颜色时。我必须使用NewAddress
Map.PinClicked += (sender, args) =>
{
IsPinVisible = true;
NewAddress = Address;
};
Map.PinClicked += (sender, args) =>
{
IsPinVisible = true;
NewAddress = Address;
};