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

Listview - footer at the bottom right corner

$
0
0

I want to have a footer below Listview which is placed at the bottom right corner when there is not too much items in the listview. Here is my code:

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:Todo"
             x:Class="Todo.Views.TodoItems"
             xmlns:viewModels="clr-namespace:Todo.ViewModels"
             xmlns:controls="clr-namespace:Todo.Controls;"
             xmlns:suaveControls="clr-namespace:SuaveControls.Views;assembly=SuaveControls.FloatingActionButton"
             Title="Things to do!">
    <ContentPage.BindingContext>
        <viewModels:TodoItemsViewModel />
    </ContentPage.BindingContext>
    <StackLayout VerticalOptions="FillAndExpand">
        <ListView VerticalOptions="FillAndExpand" x:Name="listView" Margin="20,20,20,0" ItemsSource="{Binding TodoItems}" HasUnevenRows="True" SeparatorVisibility="None">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <ViewCell>
                        <Frame Padding="5" Margin="7" HasShadow="True" MinimumHeightRequest="80">
                            <Grid VerticalOptions="Center" HorizontalOptions="Center">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="2.5*"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="1.5*"/>
                                </Grid.ColumnDefinitions>
                                <Label Grid.Column="0" Text="{Binding Name}" VerticalTextAlignment="Center" HorizontalTextAlignment="Start" Margin="25,0,0,0" />
                                <Switch Grid.Column="1" IsToggled="{Binding Done}" HorizontalOptions="Start"/>
                            </Grid>
                        </Frame>
                    </ViewCell>
                </DataTemplate>
            </ListView.ItemTemplate>
            <ListView.Footer>
                <Label Text="lalalala" VerticalOptions="EndAndExpand" HorizontalOptions="End"/>
            </ListView.Footer>
        </ListView>
    </StackLayout>
</ContentPage>

It is not working even if I use FillAndExpand. I was searching on the Internet looking for the solution. Is there any way to achieve that footer at the bottom right corner when there is not too much items in the listview?


Viewing all articles
Browse latest Browse all 77050

Trending Articles