SfListView not rendering into absolute layout

If I try to render the listview into absolutelayout the list is not rendered.
What am I forgetting?

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"

             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"

             xmlns:sync="clr-namespace:Syncfusion.ListView.XForms;assembly=Syncfusion.SfListView.XForms"

             xmlns:local="clr-namespace:Habitatsoft.UI.ViewModels;assembly=Habitatsoft.UI"

             x:Class="Habitatsoft.UI.Pages.ContactsSyncfusionPage">


    <ContentPage.BindingContext>

        <local:ContactsSyncfusion />

    ContentPage.BindingContext>



    <AbsoluteLayout VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">

        <sync:SfListView x:Name="listView"

                     ItemsSource="{Binding BookInfo}"

                     ItemSize="100">

            <sync:SfListView.ItemTemplate>

                <DataTemplate>

                    <Grid Padding="10">

                        <Grid.RowDefinitions>

                            <RowDefinition Height="0.4*" />

                            <RowDefinition Height="0.6*" />

                        Grid.RowDefinitions>

                        <Label Text="{Binding BookName}" FontAttributes="Bold" FontSize="21" />

                        <Label Grid.Row="1" Text="{Binding BookDescription}" FontSize="15"/>

                    Grid>

                DataTemplate>

            sync:SfListView.ItemTemplate>

        sync:SfListView>

    AbsoluteLayout>





1 Reply

MK Muthu Kumaran Gnanavinayagam Syncfusion Team December 13, 2017 05:23 PM UTC

Hi Eduard, 
 
We would like to enlighten you that while loading elements inside AbsoluteLayout you need to specify the position and size for its child Views. You can either set proportionate size or specific size to SfListView as like below. 
 
Code Example[XAML]: (Proportional size) 
<listView:SfListView x:Name="listView"  
                                 AbsoluteLayout.LayoutBounds="0, 0, 1, 1" 
                                 AbsoluteLayout.LayoutFlags="All" 
                                 ItemSize="150" 
                                 ItemsSource="{Binding contactsinfo}" > 
 
Code Example[XAML]: (Specific size) 
<listView:SfListView x:Name="listView"  
                                 AbsoluteLayout.LayoutBounds="115,150,100,100" 
                                 ItemSize="150" 
                                 ItemsSource="{Binding contactsinfo}" > 
 
For more details please refer the below documentation link. 
 
 
Please let us know if you require further assistance. 
 
Regards, 
G.Muthu kumaran. 


Loader.
Up arrow icon