繁体   English   中英

Xaml在半页上显示地图,另一半信息以xamarin形式显示

[英]Xaml display map on half page , another half information in xamarin forms

我正在尝试创建以下视图。 我的看法

我似乎没有做到这一点,我尝试了不同的方法,但没有奏效。 这甚至可能以 xamarin 形式出现吗? 这就是我所拥有的:我的观点:

<StackLayout>
    <local:CustomMap x:Name="customMap" 
                     MapType="Satellite" 
                     WidthRequest="{x:Static local:App.ScreenWidth}" 
                     HeightRequest="{x:Static local:App.ScreenHeight}" />

    <ListView x:Name="listviewname"
              HasUnevenRows="True">
        <ListView.ItemTemplate>
            <DataTemplate>
                <ViewCell>
                    <StackLayout Padding="20, 10">
                        <Label  Text="{Binding Information}"
                                 FontSize="15" 
                                HorizontalOptions="Start"/>
                        <Label  Text="{Binding More Information}"
                                 FontSize="15"/>
                        <Label  Text="{Binding MoreInformation}"
                                FontSize="15"/>
                    </StackLayout>
                </ViewCell>
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>
</StackLayout>

但这仅显示我的地图。 一些帮助将不胜感激。 谢谢 :)

您可以使用Grid将页面分成 2 个部分。 类似的东西应该让你开始:

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="*" />
        <RowDefinition Height="*" />
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <maps:Map Grid.Row="0" />
    <ListView Grid.Row="1" x:Name="listviewname" HasUnevenRows="True">
        <ListView.ItemTemplate>
            <DataTemplate>
                <ViewCell>
                    <StackLayout Padding="20, 10">
                        <Label  Text="{Binding Information}" FontSize="15" HorizontalOptions="Start"/>
                        <Label  Text="{Binding More Information}" FontSize="15"/>
                        <Label  Text="{Binding MoreInformation}" FontSize="15"/>
                    </StackLayout>
                </ViewCell>
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>            
</Grid> 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM