【发布时间】:2019-07-06 18:14:24
【问题描述】:
我的应用非常简单:它在上半部分显示Xamarin.Forms.Map,在下半部分显示ListView。
这是我的xaml:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:maps="clr-namespace:Xamarin.Forms.Maps;assembly=Xamarin.Forms.Maps"
xmlns:local="clr-namespace:GasStations"
x:Class="GasStations.MainPage">
<StackLayout>
<StackLayout VerticalOptions="FillAndExpand">
<maps:Map WidthRequest="960" HeightRequest="200"
x:Name="MyMap"
IsShowingUser="true"/>
<ListView x:Name="ListView_Pets">
</ListView>
</StackLayout>
</StackLayout>
</ContentPage>
这是模拟器中的应用:
当我在地图上单击时,我想隐藏ListView,并在底部显示“显示列表”。或多或少是这样的:
我在 MainPage 类中添加了一个类似这样的事件处理程序(类似于 trouble in Hide/show of listview on a click in xamarin android),但它没有构建:
public MainPage()
{
InitializeComponent();
/* Fills ListView and plots points in map */
ListView_Pets.ItemClick += OnListItemClick;
}
【问题讨论】:
标签: android xamarin xamarin.forms visual-studio-2017 xamarin.forms.listview