HorusSoftwareUY / Xamarin.Forms.Skeleton

The new loading approach for cool apps in Xamarin Forms
MIT License
451 stars 52 forks source link

Skeletons are not showing #7

Closed m-u-z-k-y closed 4 years ago

m-u-z-k-y commented 4 years ago

I've added the following code to my xaml.

At the top: xmlns:extension="clr-namespace:Xamarin.Forms.Skeleton;assembly=Xamarin.Forms.Skeleton"

<local:GradientColorStack StartColor="{StaticResource SenseBlue}" EndColor="{StaticResource SenseLightBlue}">

            <AbsoluteLayout VerticalOptions="Fill">
                <ListView ItemsSource="{Binding Geozones}"                      
                      HasUnevenRows="True" 
                      BackgroundColor="Transparent"
                      SelectionMode="None"     
                      SeparatorVisibility="None"
                      AbsoluteLayout.LayoutFlags="All" 
                      AbsoluteLayout.LayoutBounds="0,0,1,1" 
                      IsPullToRefreshEnabled="True"
                      IsRefreshing="{Binding isRefreshing}"
                      RefreshCommand="{Binding PullRefresh}"
                      extension:Skeleton.IsParent="True"
                      extension:Skeleton.IsBusy="True"
                      extension:Skeleton.Animation="Fade"
                >
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <ViewCell >
                                <StackLayout Orientation="Vertical">
                                    <!-- Divider -->
                                    <Grid BackgroundColor="Transparent" 
                                      HeightRequest="20"/>
                                    <!-- Content -->
                                    <Frame Padding="0" CornerRadius="5" HasShadow="True" Margin="20, 0, 20, 0" BackgroundColor="White" extension:Skeleton.BackgroundColor="White" extension:Skeleton.IsBusy="True">
<!-- Rest of my code -->

The list view just loads in normally, no skeletons appear at all.

AgustinBonilla commented 4 years ago

Hi @m-u-z-k-y , the approach to implement the Skeleton component is that we want to use a different property value when it is busy and when not is busy, in your sample you are using the same BackgroundColor, for example, you should change to extension:Skeleton.BackgroundColor="Red", also, we recommend binding a model property to the extension:Skeleton.IsBusy property. We recommend reviewing the following XAML to have it as a reference: https://github.com/HorusSoftwareUY/Xamarin.Forms.Skeleton/blob/master/SkeletonExample/SkeletonExample/Pages/Page1.xaml If you can't resolve to appear the skeleton, reopen the issue and upload an example to reproduce it. Thanks in advance!