Добавление болванки между ListView - PullRequest
1 голос
/ 02 ноября 2019

Я не могу понять, как я могу добавить промежуток между моими элементами списка, чтобы первые три остались наверху, а остальные два - на нижней части выдвижной панели.

У меня естьслышал что-то о добавлении рамочного представления между элементами, но разве это не будет выглядеть по-другому на других устройствах и ОС?

Это код, я использую обычную страницу основных деталей с некоторыми слегка измененнымиэлементы

<?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:d="http://xamarin.com/schemas/2014/forms/design"
         xmlns:mc="http://schemas.openxmlformats.org/markup- 
         compatibility/2006"
         mc:Ignorable="d"
         x:Class="StudyBuddyApp.Components.MainPageMaster"
         Title="Master">

<StackLayout>

<ListView x:Name="MenuItemsListView"
          SeparatorVisibility="None"
          HasUnevenRows="true"
          ItemsSource="{Binding MenuItems}">
    <d:ListView.ItemsSource>
            <x:Array Type="{x:Type x:String}">

                <x:String>Profile</x:String>
                <x:String>Forums</x:String>
                <x:String>Find Buddy</x:String>

<!---I want a gap in between these two list items--->

                <x:String>Help and Settings</x:String>
                <x:String>Sign Out</x:String>

            </x:Array>
    </d:ListView.ItemsSource>

    <ListView.Header>
    <Grid BackgroundColor="#660066">

        <Grid.ColumnDefinitions>
        <ColumnDefinition Width="10"/>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="10"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
        <RowDefinition Height="30"/>
        <RowDefinition Height="80"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="10"/>
        </Grid.RowDefinitions>

        <Label
            Grid.Column="1"
            Grid.Row="2"
            FontSize="Large"
            TextColor="White"
            Text="StudyBuddy"
            Style="{DynamicResource SubtitleStyle}"/>

    </Grid>

    </ListView.Header>

    <ListView.ItemTemplate>
        <DataTemplate>
            <ViewCell>

                <StackLayout Padding="15,10" 
                 HorizontalOptions="FillAndExpand">
                    <Label VerticalOptions="FillAndExpand" 
                        VerticalTextAlignment="Center" 
                        Text="{Binding Title}" 
                        d:Text="{Binding .}"
                        FontSize="24"/>
                </StackLayout>
            </ViewCell>

        </DataTemplate>
    </ListView.ItemTemplate>

    </ListView>
  </StackLayout>
</ContentPage>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...