Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 81910

Can a ListView footer fill the bottom empty space?

$
0
0

Hi all, thanks for taking a look at this. Can anyone suggest how to make the footer fill the empty area between the Listview and the "Next" button as seen in the attached screen shot?

Alternately, can a background color be specified for EntryCell instances? Filling the populated rows' background with one color and the empty ListView area with another color would also work.

Here's my current Xaml implementation. Thanks again for any suggestions.

<?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:local="clr-namespace:PrismNavTest"
                xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms"
                prism:ViewModelLocator.AutowireViewModel="True"
                x:Class="Golf.Views.AddOrEditCoursePage"
                NavigationPage.BackButtonTitle=""
                Title="{Binding PageTitle}"
                >

    <StackLayout Spacing="0">
        <ListView   ItemsSource="{Binding CourseInfoProperties}" 
                    HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"
                    BackgroundColor="Yellow"
                    >

            <ListView.ItemTemplate>
                <DataTemplate>
                    <EntryCell  Label="{Binding Label}" 
                                Text="{Binding Text, Mode=TwoWay}" 
                                Placeholder="{Binding OptionalText}" 
                                Keyboard="{Binding KeyboardType}" 
                                XAlign="End" 
                                />
                </DataTemplate>
            </ListView.ItemTemplate>

            <ListView.Footer>
                <StackLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Spacing="0">
                    <Label  HorizontalOptions="FillAndExpand"
                            FontSize="Micro" HorizontalTextAlignment="Center" 
                            BackgroundColor="Gray" TextColor="Silver"
                            Text="All fields are required unless marked &quot;Optional&quot;" 
                            />
                    <BoxView Color="Gray" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" />
                </StackLayout>
            </ListView.Footer>

        </ListView>

        <Button Text="Next" BackgroundColor="Maroon" TextColor="White" BorderRadius="0" />
    </StackLayout>

</ContentPage>

Viewing all articles
Browse latest Browse all 81910

Trending Articles